-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[BUG] npm v7 breaks itself upon installing itself in --global --production
mode.
#1708
Comments
Why would you be installing in production mode explicitly? Dev deps only show up if you run |
I suppose it was from misremembering the facts you just mentioned. Do global installs not include (EDIT: You appear to be right. I actually can't get npm 6 to install the In any case, these "steps to reproduce" do not break existing, stable releases of |
For better or for worse, I seem to recall that it's a common thing in various READMEs to tell users to do global package installs with the For example, And Node's documentation page: https://nodejs.org/docs/v14.9.0/api/n-api.html#n_api_building (Probably copy-pasted from Update: I sent PRs to Node [1] and node-gyp [2] and they're landed. So users in the future won't have the confusion I did about |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
--global --production
mode.--global --production
mode.
Update: This still applies, tested with stable [email protected]. If you run |
i'm not able to reproduce this, can you try it with 7.0.9? |
Hi @nlf, I am still able to reproduce it with npm 7.0.9 on Node 12 and Node 14, but I mostly cannot reproduce it on Node 15. Strangely, only once I was able to run the command Maybe this is an intermittent issue. And I do think it happens less often on Node 15. I have a mechanical hard drive if that has anything to do with it? (Speculating if it may be a race condition). |
I think this is fixed now, thanks for working on this @nlf! I tested, and I could not reproduce the bug on the following Node versions:
Tested on my macBook, macOS 10.15.7 Catalina. |
Current Behavior:
npm 7 is broken after installing itself in
--global --production
mode.Expected Behavior:
npm 7 installing itself in
--global --production
mode should not cause a brokennpm
install.Steps To Reproduce:
From a working, stable release of
npm
, run the following command twice and you will have a broken install ofnpm
.npm install --global --production npm@next-7
npm install --global --production npm@next-7
(Once more, with feeling!)At this point, npm has reinstalled itself in a broken way, and no
npm
subcommands that I've tried will work.Environment:
The text was updated successfully, but these errors were encountered: