Force using pnpm in the project
When using npm i
or pnpm
to install the package, an error will be thrown and the installation will stop.
Update package.json
:
{
"scripts": {
"preinstall": "npx please-use-pnpm"
}
}
Note: If you don’t want to see npx: 1 installed successfully, took xxxx seconds
, you can use the --quiet
option (or -q
):
{
"scripts": {
"preinstall": "npx -q please-use-pnpm"
}
}