-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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] "ERR! Cannot find module 'agentkeepalive'" trying to "npm install -g [email protected]" #2818
Comments
Interestingly, despite
So...I ran I guess then the notice should be changed for those of us running nvm? (I'm also curious why the recommended method didn't work, because I'm pretty sure I've upgraded exactly the same way previously, without trouble.) |
Unfortunately npm v7.5.3 had some issues, and once you'd upgraded to it in your node v12.16.1, you may have had to uninstall and reinstall that node version to be able to get a newer version of npm. I don't think this has anything to do with nvm itself (except that you were able to switch to a different node version that avoided the problem) |
Ah, OK...I didn't have to uninstall anything, I just used nvm to install the latest Node.js and then used nvm to install the latest npm. I'm not sure installing the latest Node.js even helped, necessarily, because as you can see above, the latest still had npm v6 attached to it. |
Only node 15 ships with npm 7 initially. |
I'm not sure if this is the exact same issue, but I also have trouble upgrading my npm to the latest version (now
|
Had the same problem on Mac OS when running |
Just retried the same |
Interesting that the different formats give different results even though they target the same version in the end! Maybe that's the easiest way to fix the notification text so that it's universally applicable, then... |
Hi there 👋🏻 I am currently facing the same issue. Env:
|
Interesting ... When removing the line
|
This appears to be a transient issue. Using these repro steps, sometimes the install succeeds, and sometimes it fails with
|
Node.js 15.13.0 here with npm 7.8.0 Failing in my CI environment when trying to upgrade to 7.9.0:
|
Just to add a data point, if it helps: Same error as OP for node v15.5.0 installed via nvm 0.35.3 on Ubuntu 18.04.5 LTS. Installed agentkeepalive manually to get npm updated. |
Installed node via
I'm on an M1 Mac. |
Same here. Linux Mint 20 |
Same on Big Sur 16" MBP 2019. I predict 3,000 "me too" comments coming soon. 🤔 Perhaps obviously, installing |
I got the same error (ERR! Cannot find module 'agentkeepalive') when trying to run the update for npm globally: |
Thanks @evictor (and @hs749 for confirming), it seems to be a solid workaround, worked like a charm for me :) I had the same issue while trying to update npm from 7.11.2 to 7.13.0: I installed "agentkeepalive" ( [Linux 64 / Pop!_OS 20.10 (Intel version)] |
It makes sense for the update to work after a [Faced on Arch 5.12.4 Intel] |
@yashank09 i believe it's long since been fixed, but anyone stuck on older npm versions where this problem exists can't ever avoid having this problem. |
@ljharb I see. I was setting up a new system so just installed nvm on arch. The older version was included by default which led me to this error. This should be resolved once nvm upgrades to the latest version out of box. |
@yashank09 it's got nothing to do with nvm. the version of node installed is determined by your |
Also faced the
on Windows 10 Pro |
same here it worked on second attempt though
here is the log in case it gives any clues
I'm on an Intel Mac (Catalina) |
This happened to me today as well (Ubuntu 20.04, x86_64, Node.js v14.15.4, npm was 7.12.1):
I got the command from:
Dropping the version constraint worked:
Please consider fixing this bug or at least changing the suggested upgrade command. |
This bug was fixed in ref: e92b5f2 |
If you are consistently getting this error, and omitting the version does not work, you can install the newest npm via our install script: $ curl -qs https://www.npmjs.com/install.sh|sh |
Thanks, fixed it for me! |
Same here, thank you. |
I've just come across this issue and what solved it in my case was switching node (using nvm) from v14.15.1 to v14.17.0. |
As far as I know, this is not:
npm install -g npm
may break npm installation #555 (I don't recall trying to upgrade and breaking anything, previously; plus, npm is not installed as root: if I try the same command with sudo, I getsudo: npm: command not found
)Current Behavior:
When I open a terminal, I get this message:
When I run
npm install -g [email protected]
as it suggests, I get:Expected Behavior:
A successful upgrade to npm 7.6.0.
Steps To Reproduce:
npm install -g [email protected]
The text was updated successfully, but these errors were encountered: