-
-
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
NPM not recognized in Powershell or Command Prompt #612
Comments
probably related to #606 |
It's probably more like each node version installed with nvm have separate npm and changing version in NVM is not changing path to right npm. And also each node has separate node-modules, so packages installed with different node and npm are in different locations |
@shorstki is correct. There is a different installation directory for each version of node and its modules. Global npm modules must be reinstalled for each version, since each version is treated separately. There are other reasons npm may not be recognized. Spaces in path names/install roots were a challenge in v1.1.7, but have been resolved in https://github.com/coreybutler/nvm-windows/releases/tag/1.1.8. Lacking permissions can also cause this when using a protected directory (like I'm closing this because I believe the technical issues have been resolved in v1.1.8. It is important to understand that each version of Node is treated as an independent installation though. Managing the npm environment is not in the scope of this project, but it is being considered in rt (the successor project I'm working on - see the "welcome" thread in the Github discussions for details). |
This is because it is powershell, try command prompt (administrator) |
@aahmedfaraz no - this is not due to the shell. NVM4W is supported in both PowerShell and the standard command prompt. |
unfortunately it's not working in new version. |
My Environment
I noticed that NVM installed in:
C:\Users[user]\AppData\Roaming\nvm\
It created a symbolic link in "C:\Program Files\nodejs" pointing to:
C:\Users[user]\AppData\Roaming\nvm\v15.8.0
It also created the following system environment variables:
NVM_HOME: C:\Users[user]\AppData\Roaming\nvm
NVM_SYMLINK: C:\Program Files\nodejs\
and the following user environment variables:
NVM_HOME: C:\Users[user]\AppData\Roaming\nvm
NVM_SYMLINK: C:\Program Files\nodejs\
The path system and user environment variable includes both:
%NVM_HOME%
%NVM_SYMLINK%
Expected Behavior
npm install -g angular@latest should work.
Actual Behavior
node --version works and returns the correct version number. However NPM does not.
Steps to reproduce the problem:
Download the installer for windows. (1.1.7)
Run the installer.
Install Node v15.8.0
The text was updated successfully, but these errors were encountered: