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
nvm installs node but fails to deliver npm #456
Comments
Are you 100% certain you're running 1.1.7? I ask because the npm/cli change was a hardcoded URL issue that existed in 1.1.6 and was fixed in 1.1.7. |
unfortunetly, 100% certain @coreybutler here's my screenshot of the version: A friend of mine just installed nvm 1.1.7 on his machine and I upgraded mine as well to get the latest version of npm, with no luck unfortunetly |
Sorry, had to ask :-) I cannot recreate this. Typically it comes down to a) permissions, b) network issue during the download. Sometimes the network issue is on the remote server, especially when a brand new node/npm release has been pushed. This error message crops up all the time, but for lots of different reasons, making it difficult to identify the real source of the issue. |
To reproduce this issue I had to uninstall Node and NPM and do a fresh install using only NVM, then I get the error. I've noticed that during the install process the NPM related stuff is downloaded to a temp folder, but later it's never moved anywhere and the temp folder is deleted. |
@gsicoli You're correct that npm downloads to a temp directory and is then moved. If the move operation is silently failing, it would cause the directory to be deleted without moving npm where it needs to be (i.e. this behavior). Are you prompted when you run |
It prompts when I don't run as administrator. If I run as administrator it doesn't prompt... Nonetheless the effect is the same. |
Facing the same issue on Windows 10. If there is any information I can provide, I will be happy to help! It does not seem to be related to a certain version of node though; the node_modules folder is always empty for the versions I attempt to install. I am prompted for elevated permissions. |
Have the same problem. Is there a workaround? |
Have the same problem. This is my attempt and works for me:
|
Have the same problem. So, I have applied workaround from @liuwenzhuang. Indeed, now |
Turning off McAfee and running install from admin console fixed this for me. |
@helzgate: This makes no sense for me. My virus logs show exactly nothing. |
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. |
I'm running into the same issue, but it seems to happen only with installing node 6 (or happens because I installed node 6 after doing |
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? |
Note, this comment totally works! Would be great if this is what the |
@matthew-dean Same here with McAfee. Though they didn't properly define my permissions so I can disable it. I will see if that is the cause of the issue tomorrow when I am back at work. I wouldn't be surprised; the package installer of dart reported a similar issue when installing some package (which also worked through downloading to temp and then moving somewhere else). |
Yup this is indeed the issue for me! There is some operation there that McAfee Endpoint Security silently prevents. Installing any version with McAfee active => no npm |
Is the error mentioned above, when executing |
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) |
Thanks! Following an improved version of that script for bash. (You may need to adjust the function npmup {
pushd /c/Program\ Files/nodejs > /dev/null
mv npm npm2
mv npm.cmd npm2.cmd
mv npx npx2
mv npx.cmd npx2.cmd
node node_modules/npm/bin/npm-cli.js up npm -g
mv -n npm2 npm
mv -n npm2.cmd npm.cmd
mv -n npx2 npx
mv -n npx2.cmd npx.cmd
rm -f npm2 npm2.cmd npx2 npx2.cmd
popd > /dev/null
} |
The comment I referred to has since been removed, sorry for the confusion. |
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. |
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. |
@hind3nbug Same for me, McAfee Endpoint Security is not disable-able on a corporate machine, so there really still needs to be a proper way to install NPM. There should be some way to do this. |
Can you share your version? I am not able to build nvm from source code :( |
@hind3nbug & @coreybutler... so is this issue was resolved? but not released new nvm version? when a new version is estimated? |
I had Nodist installed prior to nvm-windows. It left a |
Had this happen to me today - uninstalling the version and then reinstalling it seemed to fix the issue. |
I tried everything for two days... nvm, node re-install, restarts, PATH changes, and this is the only thing that actually worked like a charm! |
@coreybutler can I suggest adding @liuwenzhuang 's suggestion to readme.md or Common-Issues? This can save someone's time. |
Hola, es mi caso, este mensaje en la consola me dió la pista sobre el error:
Si vamos a la página https://github.com/npm/npm/, se indica que el repositorio se ha movido y que ahora está en https://github.com/npm/cli. Es decir, que habría que buscar la v6.14.4 en dicho repositorio. |
I have also faced same issue on Windows 10. And it can be resolved by disabling the McAffe protection. Open McAffe Endpoint Security > Threat Prevntion > Disable Access Protection and On access scan module (Uncheck) @coreybutler : I think you should provide some relative notification if npm not installed properly. |
Thanks @liuwenzhuang Your Comment really helped today. I have been battling with this bug for some days now |
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:
Then made new symlink to a version I had downloaded using nvm:
I haven't tried |
This worked !!! I also had the same issue with McAfee + Win 10 + PowerShell. - Many thanks @liuwenzhuang |
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? |
This comment works for me: #475 (comment) Just doing |
When your local npm's version is latest, it may not install the same version npm when you installing latest node, does that will happen? |
One of my office machine has McAfee and I think it is stoping to install(copying) the npm folder. But below step comes like a rescue for me. Thanks.
This works from me, like a charm!!
@coreybutler thought? Thanks. |
@Amitesh - I think having integrity checks is a good idea. However; I don't have time to do that right now (see the discussion tab, first post). I would accept a PR if someone wanted to add this. |
I'm still facing issue npm not recognized on windows 10 for newly installed node(10.23.0) using nvm (1.1.7)
|
Just found a workaround, looking at the comments related to antivirus protection. I am on Windows 10, 64 bit, version 1909 (build 18363.1139)
|
After a long time not working with my Windows laptop I decided to update the Node.js version from 8 to 14. Yet I encountered the bug which I assume many others have also faced here. Your comment helped me to pinpoint the cause although your instructions didn't exactly solve my problem. For me the issue was that nvm uses an environment variable |
in case anyone is still having this issue ... this is what I did to get it to work. (note: i had version 14.4.0 of node installed outside nvm) - after installing NVM it asked to mange 14.4.0 and i said yes ... i think this is what caused the NPM issue to not work.. ...
hopefully NPM should now work ... |
had similar issues with ran looks like certain versions dont properly install npm with |
experienced the same issue with v1.1.5 but mine was installed via chocolatey and also had both nvm and nvm portable previously installed. uninstalled both via chocolatey then installed (not via choco) the current maintenance release 1.1.7. issue solved. glad i didnt hv to go the route of manually copying the folders. thank you for this tool. hope it gets updated. |
happen to me today using power shell, install node v9.9.0 no npm installed |
Worked for me! |
NB: I did the two items below:
I also tried to install the version you couldn't achieve above, and it was successful, see screenshot below. |
This post helped me. Uninstall Node.JS, uninstall nvm, reinstall nvm |
This worked for me
|
When using Norton 360, disabling its auto-protect allows installation of npm which is otherwise blocked. |
I just ran
then
and it brought npm back |
Something to check is make sure npm is not being used by another process when trying to update. |
same case with yours, but when I run cmd as administrator, that problem disappeared !!!! and you can try to install a different node LTS version, good luck |
I had a fresh install of Windows 11 with no previous node installation. |
I had a variable in my system path for ".../yarn/bin/" and after removing that the issue has gone. |
My Environment
I'm using NVM4W version:
I have already...
My issue is related to (check only those which apply):
Expected Behavior
After running
nvm install latest
that node version12.5.0
and npm versionv6.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.
The text was updated successfully, but these errors were encountered: