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.
[ ] Windows Server 2016
[ ] My Windows installation is non-English.
After I install nvm-windows, the C:UsersadminAppDataRoamingnpm that contains all my global commands should be added into PATH variable but this is not.
This is not - I have to manually go and add this directory to PATH variable
Install nvm-windows
run npm install -g @angular/cli
close powershell window and re-open
run "ng new newProject"
It's going to say it "ng is not recognised command"
Go into environment variables, and add "C:UsersadminAppDataRoamingnpm" to PATH
Open another powershell window, and run "ng new newProject", it'll now work
Actually maybe this is me misunderstanding how nvm-windows is supposed to work.
Can someone clarify, is nvm-windows supposed to put my global npm packages (eg. yarn, ng) into c:usersadminappdataroamingnvm?
It looks to me on my computer, the global packages are put in c:usersadminappdataroamingnpm - only the node versions are put into c:usersadminappdataroamingnvm.
This is why the global commands do not work until I add c:usersadminappdataroamingnpm into SYSTEM PATH.
Can someone clarify, is nvm-windows supposed to put my global npm packages (eg. yarn, ng) into c:usersadminappdataroamingnvm?
No it is not. That is the right behavior you are experiencing. Also nvm adds the c:\users\admin\appdata\roaming\npm
to the PATH if it didn't you couldn't access npm.
Can someone clarify, is nvm-windows supposed to put my global npm packages (eg. yarn, ng) into c:usersadminappdataroamingnvm?
No it is not. That is the right behavior you are experiencing. Also nvm adds the
c:\users\admin\appdata\roaming\npm
to the PATH if it didn't you couldn't access npm.
Ok well it didn't add the c:\users\admin\appdata\roaming\npm
directory to PATH for me. I had to manually add this afterwards.
It added NVM_HOME which linked to c:usersadminappdataroamingnvm and
NVM_SYMLINK which linked to c:program filesnodejs
i could access npm because c:program filesnodejs was pointing to my current version of node (eg. C:UsersadminAppDataRoamingnvmv10.10.0)
I was getting this issue but realised this hadn't run this sucessfully
nvm install 8.12.0
Downloading node.js version 8.12.0 (64-bit)...
Complete
Downloading npm version 6.4.1... Download -failed. Rolling Back.
I think this explains the path not set. Anyway installed nvm 1.17 and successfully run the above - it adds these env vars which get appended to the path env var
NVM_HOME=C:\Users\danie\AppData\Roaming\nvm
NVM_SYMLINK=C:\Program Files\nodejs
npm is seen by the path and I stop getting the error mentioned in this thread
位 npm version
{ npm: '6.4.1',
.....
I thought I would repeat the above on the laptop supplied by my client
1) installed the last verison of NVM4W installer (1.17.4)
2) set the proxy url
nvm proxy myclientproxy.com:xxxx
位 nvm install 8.12.0
Downloading node.js version 8.12.0 (64-bit)...
Complete
Downloading npm version 6.4.1... Download failed. Rolling Back.
Rollback failed. remove C:\Users\Daniel\AppData\Roaming\nvm\temp\npm-v6.4.1.zip: The process cannot access the file because it is being used by another process.
Could not download npm for node v8.12.0.
Please visit https://github.com/npm/cli/releases/tag/v6.4.1 to download npm.
It should be extracted to C:\Users\Daniel\AppData\Roaming\nvm\v8.12.0
Any advice on how resolve this or perform a manual install.
I had Nodist installed prior to nvm-windows. It left a .npmrc
file under home directory (%userprofile%
). I had to remove it and try nvm use
command again to get everything right.
I don't know that my path had anything incorrect or missing, but re @ismailkattakath's solution, I also had extra .npmrc
files laying around (in two places), and deleting them and attemting an npm install buzzphraze -g
command worked and installed the package in the right place. Before this it was maddeningly creating a c\blar\mcblar\
folder structure in my drive root (in Windows).
Edit: on windows 7. For which the extras installs fails (and I got chocolatey installed through manual wrangling) because it is coded for powershell 1 but chocolately now requires TLS2 and powershell 5 to install. I wonder if the extras installs failures created .npmrc
files in the wrong places.
Most helpful comment
I thought I would repeat the above on the laptop supplied by my client
1) installed the last verison of NVM4W installer (1.17.4)
2) set the proxy url
nvm proxy myclientproxy.com:xxxx
Any advice on how resolve this or perform a manual install.