-
-
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
Can't install npm #551
Comments
UPDATE - this seems to fix things |
@8secz-johndpope I am having this same issue. However, I am trying to understand this fix and will be so glad to get some clarifications. So here are my thoughts - Downloading and Installing the nodejs from the official website should fix the issue because, during nodejs installation (using the msi), npm will be installed globally and added as an environmental variable which should definitely fix the issue. However, this means anytime we call "npm" from the command line, it ends up calling the global npm instead of calling an npm that is tied to the version of node we instructed nvm to use via I hope you understand all I have said above. Please let me know if something is wrong with my thoughts - as regards how nvm does its work. I will also love to get this fixed at my end and will want to know if your fix is the way to go. Thanks a lot! |
@8secz-johndpope I think what I said about creating an environmental variable might be wrong. I can see what happens is that the system checks the installed nodejs folder for an npm file and an npm.cmd file (and a node_modules/npm/bin directory) whenever we type By default, After installing nvm, it puts a nodejs shortcut in your Program Files directory. This shortcut automatically links to the active nodejs in use by nvm (active nodejs that must have been set using the command However, I tried your fix on one of the nodejs versions I installed via nvm (I had installed multiple versions of nodejs and none of them had npm installed). So, I downloaded the msi file for one of the nodejs versions. Note: Before installing, I had to tell nvm to |
I got the same problem. waiting.... |
Also currently dealing with exactly the same issue. |
@Xeinn I'm not on windows these days - but try to install node.js from here https://nodejs.org/en/ |
@8secz-johndpope Thanks for the link and note, have resolved the issue myself with a similar approach you mention.
Installing node using installer hits issues if you need to install an earlier version - on windows the msi installer doesn't allow you to proceed. Above worked for me but is obviously less convenient than installing via nvm itself, be good if the cause could be found and fixed, but at least I can work around it for now. I suspect for the above to work properly you do need to make sure your environment variables are clear of all but the NVM created entries for adding node to the path etc. |
This is often a symptom of not uninstalling prior versions of Node or removing stale npm installations prior to installing NVM4W. This is why the README states these activities need to occur before installing NVM4W. If you've followed the instructions and still see this error, other potential causes are permissions (i.e. not running as an admin), or in certain circumstances, npm itself. There were a few versions of npm (cannot remember specific npm versions, but the were released in the 8.x.x and 12.x.x Node installs respectively) which shipped with hard coded paths, causing these kinds of problems. This is why specific installations of (using msi's) work while version managers do not (this is not specific to NVM4W). |
This is probably caused by AV scanning, and is a duplicate of #364 |
In my case, it's probably not working b/c there is no such release. NPM was moved to https://github.com/npm/cli.
|
Hi, were you able to get this right.? |
These issues have been addressed in 1.1.7 and 1.1.8. From node 16.9.0 and up, NVM4W uses a new distribution file that bundles node and npm in a single download. This feature is available in https://github.com/coreybutler/nvm-windows/releases/tag/1.1.8 |
Make sure you have reviewed the common issues and existing issues before submitting a new issue.
If this is a question about how to use NVM4W, please use stackoverflow instead.
If this is an issue regarding antivirus, make sure you search the existing issues first.
My Environment
Windows 7 or below (not truly supported due to EOL - see wiki for details)
Windows 8
Windows 8.1
Windows 10
Windows 10 IoT Core
Windows Server 2012
Windows Server 2012 R2
Windows Server 2016
My Windows installation is non-English.
I'm using NVM4W version: 1.1.7
Run
nvm version
if you don't know.I have already...
My issue is related to (check only those which apply):
I have a user with admin access and I have the latest nvm. When I try to install any version of node the installation passes but the npm folder is always empty. During the installation I checked the temp folder and noticed the zip was downloaded. I also saw that the zip gets properly extracted. I think something fails when npm-cli is moved from the temp folder but the installation doesn't show any error. I always end up with the broken node setup, where npm is missing.
The text was updated successfully, but these errors were encountered: