-
Notifications
You must be signed in to change notification settings - Fork 193
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
How to prevent from running npm install
in pnpm or yarn projects?
#674
Comments
Do I understand right if you wish to prevent developers from running installation with anything but your specified package manager? If so it doesn't seem like anything core pack could support per se as the entrypoint in case is npm. corepack is primarily a package-manager bridge, not a script executor. How about a |
You can use |
It can help. Thanks. But...still looks weird. This propery is not widely supported by yarn and pnpm. A |
Unfortunately npm team made it very clear they would always disregard the |
Npm do not and won't support |
That's already the case, see https://github.com/nodejs/corepack?tab=readme-ov-file#devenginespackagemanager
Only if |
@aduh95 Awsome. I forgot I am using corepack v0.31.0. Thanks! Since corepack released v0.32.0, I think we can deprecate |
Certainly not. We have no plan to add support for |
FYI, I use yarn or pnpm via corepack. So personally, I don't need Deprecating something that has already documented in official Node website is a serious thing. |
Since corepack does not support npm, it's always possible to run a npm command within a project configured to be used with another package manager.
For example, a
package.json
has been configured"packageManager":"[email protected]"
. People can stil runnpm install
in this project.I know
@antfu/ni
and #650 can help. I also know corepack is going to completely remove ALL code about npm. However, for a better development experience, it is widely expected to throw an error when runningnpm install
in pnpm/yarn projects.Any solutions?
The text was updated successfully, but these errors were encountered: