Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Is there any way to prevent users from running 'npm install <package name>' #16942

Closed
hekod777 opened this issue Nov 10, 2017 · 1 comment
Labels
wrong repo Issues that should be opened in another repository.

Comments

@hekod777
Copy link

While using yarn, I want to have some kind of mechanism to prevent people from using npm install <package name>. I'd like to know if there is any way to get this done.

additional notes:

  1. add the following codes to package.json can prevent people from using npm install
  "scripts": {
    "preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('You must use Yarn to install, not NPM')\""
  },
  1. I asked the same questions in yarn's issue page:

yarnpkg/yarn#4895

@cjihrig
Copy link
Contributor

cjihrig commented Nov 10, 2017

The yarn issue tracker is the correct place for this question. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests

3 participants