Skip to content

项目中锁定 node 版本和管理依赖包版本

package.json
{
"scripts": {
"preinstall": "npx only-allow pnpm"
},
"engines": {
"node": ">=20.0.0"
},
"packageManager": "[email protected]"
}
.npmrc
package-manager=pnpm