nvm-windows: nvm installs node but fails to deliver npm
My Environment
- Windows 10
I’m using NVM4W version:
- 1.1.7
I have already…
- read the README to be aware of npm gotchas & antivirus issues.
- reviewed the wiki to make sure my issue hasn’t already been resolved.
- verified I’m using an account with administrative privileges.
- searched the issues (open and closed) to make sure this isn’t a duplicate.
- made sure this isn’t a question about how to use NVM for Windows, since gitter is used for questions and comments.
My issue is related to (check only those which apply):
- settings.txt
- proxy support (Have you tried version 1.1.0+?)
- 32 or 64 bit support (Have you tried version 1.1.3+?)
- Character escaping (Have you tried version 1.1.6+?)
- A standard shell environment (terminal/powershell)
- A non-standard shell environment (Cmder, Hyper, Cygwin, git)
Expected Behavior
After running nvm install latest
that node version 12.5.0
and npm version v6.9.0
is installed.
Actual Behavior
After the install command, no errors are shown:
the following issue occurs:
The node_modules/ folder is empty:
Steps to reproduce the problem:
Just install a version and check what happens. don’t know exactly how this works but it seems to be something related to the new npm/cli project url change.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 33
- Comments: 63 (5 by maintainers)
Have the same problem. This is my attempt and works for me:
node_modules
directory if it already exist inversion drectory
that located in nvm install directory(eg. C:\Users\USER_NAME\AppData\Roaming\nvm\v8.11.4).node_modules
directory toversion directory
infered in previous step.Have the same problem. Is there a workaround?
Why are people downloading node from the website to use with nvm, isn’t that what nvm is supposed to be for? 😉 you may as well not use nvm at all.
I had a phantom symlink nvm had created previously that it couldn’t delete because of shell permissions. I’m guessing it’s because I am using nvm in git bash shell as non-elevated user.
I deleted it in admin command prompt:
del /f c:\Program Files\nodejs
Then made new symlink to a version I had downloaded using nvm:
mklink /j "C:\Program Files\nodejs" "C:\Users\USER_NAME\AppData\Roaming\nvm\NODE_VERSION"
I haven’t tried
nvm use NODE_VERSION
but there’s a good chance if you delete the symlink before invoking it’ll make the link for you (I’m guessing that’s the expected behavior). Most likely would need to use something like this: https://github.com/imachug/win-sudoNote, this comment totally works! Would be great if this is what the
nvm
installer did.I can confirm this. With mcafee enabled npm is unpacked but the move fails without any error. McAfee logs show nothing at all. Disabling mcafee during installation fixes the issue. @coreybutler I know it is not a nice solution, but apparently the unzipping works so is would it be possible to directly unpack in the nodes_module/npm folder instead of unzipping to temp and moving?
I just ran
nvm uninstall NODE_VERSION
then
nvm install NODE_VERSION
and it brought npm back
Not sure why this was closed but I’m having the same issue, fresh install of Windows 10, fresh install of nvm, no Antivirus (except built-in). The official fix isn’t to bypass the very reason I’m using nvm, is it?
Thanks @liuwenzhuang Your Comment really helped today. I have been battling with this bug for some days now
Had this happen to me today - uninstalling the version and then reinstalling it seemed to fix the issue.
Using 1.1.7, I was experiencing the same issue with NPM not being copied over from the “temp” folder, when performing a fresh install of Node.js + NPM using NVM. Since I use a company machine, I am not able able to test with McAfee Endpoint Security disabled.
However, I built NVM from “master” today, and verified it is able to correctly install from scratch without issues.
Turning off McAfee and running install from admin console fixed this for me.
Do I have to do that every time I install a new version of Node.js?
I’ve been using nvm for a couple of years and never had to do
nvm on
before.I was getting a silent failure for installation of npm.
I thought it might be the Windows virus scanner, so I disabled that:
Strangely now the failure is not silent:
Can you share your version? I am not able to build nvm from source code 😦
Don’t think so. It didn’t change anything for me if I disabled McAfee or not. Also note that there are already two issues on that topic (a longer one and a shorter one with a script that allows you to still update npm it seems (I didn’t test it but it has 30+ thumbs up)
So I found the problem which is the realtime protection of windows
disable it when installing node using nvm
Just found a workaround, looking at the comments related to antivirus protection.
I am on Windows 10, 64 bit, version 1909 (build 18363.1139)
I’ve decided to close this issue because this is starting to touch on a number of other issues. Let’s stick to one issue per thread. Open a new issue if your problem is unaddressed.
I’ll try to summarize based on what I’ve read:
Did you run
nvm on
after the installation?Note that this issue isn’t just that NPM fails to install, but the NVM command-line utility also fails to recognize that NPM was not installed. IMO the installer is not doing a needed step of verifying that the directory is present, which would avoid some confusion around this issue.
I have McAfee Endpoint Security installed, but as it’s a managed PC in an office, there’s no way to disable it to see if that’s the issue. NPM continues to hang after 10 mins of going into the installation process. Is there not a way to modify NVM to at least detect hangs or that a process is not completed as intended?