Skip to main content
Version: 4.x

Only allow pnpm

When you use pnpm on a project, you don't want others to accidentally run npm install or yarn. To prevent devs from using other package managers, add the following preinstall script to your package.json:

"scripts": {
"preinstall": "npx only-allow pnpm"

Next time, when someone runs npm install or yarn install, they'll get an error message in the console.

Last updated on by Zoltan Kochan