Skip to content

Instantly share code, notes, and snippets.

@zkochan
Last active July 20, 2019 19:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zkochan/f1d101a9f825e860baa0bbc8a0aaad05 to your computer and use it in GitHub Desktop.
Save zkochan/f1d101a9f825e860baa0bbc8a0aaad05 to your computer and use it in GitHub Desktop.
How to force users of a repository to use pnpm for installation
{
"scripts": {
"preinstall": "node --eval \"!process.env.npm_config_user_agent.startsWith('pnpm/')&&(console.log('Use `pnpm install` to install dependencies in this repository')||true)&&process.exit(1)\""
}
}
@navicstein
Copy link

Is this not kinda strict? yeah got it, its optional 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment