-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[FEATURE] npm ci --global is not supported #7224
Comments
Also, |
Per the docs here: https://docs.npmjs.com/cli/v10/commands/npm-ci
This is exactly what I want to use
Makes sense; my project has both a Also thanks for pointing out the mistake in my sample; the command I want to run is |
Best practice is to not install anything globally, especially in a CI environment. Instead, you install it locally and invoke it with The entire purpose of |
@ljharb are you a maintainer of |
@klebba nope! but that doesn't make any of my statements less true. |
I see. Well, you know, that's just like uh, your opinion, man. As long as |
Teaching best practices is a gift - it's trying to help you. |
For cli tools in which you wan to dictate exactly what is installed when your package is installed (which npm itself does) you want to bundle your dependencies. Please note that yarn et al don't support that. You may also be thinking of a shrinkwrap which does what you are describing. |
Thanks for your reply. Yarn does support what I want; I already use it like this:
According to
Yes
Yes
Yes
Yes
Yes Thanks for pointing out I could update this ticket or open another with adjusted suggestions:
As I write this I also wonder: why can't I use |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When trying
npm ci --global
the following is returned: npm ERR! npm ci does not work for global packages.Expected Behavior
I'm trying to migrate a command line tool from Yarn. Currently I would run
yarn install ./my-cli-tool-written-in-nodejs --global --frozen-lockfile
...and this command installs my package globally while strictly adhering to the contents of my lock file. Seemingly equivalent to
--frozen-lockfile
isnpm ci
but this command does not appear to support this behavior.In #5698 this topic was left unresolved and closed, yet the problem persists. Thats for considering.
Steps To Reproduce
npm ci $package --global
Environment
The text was updated successfully, but these errors were encountered: