Remove the C:\Program Files\nodejs
folder and create a symlink to %USERPROFILE%\AppData\Roaming\nvm\[someversion]
If this fails for some reason, show an error message.
The folder is not removed and the symlink is not created.
N:\> nvm version
1.1.7
N:\> node -v
v12.9.0
N:\> nvm list
12.7.0
10.9.0
8.16.1
8.16.0
N:\> nvm use 8.16.1
Now using node v8.16.1 (64-bit)
N:\> node -v
v12.9.0
Not sure why this occurs. I have some thoughts but there are nog logfiles?
I've installed Node & NVM via chocolatey and run an auto update for all packages on windows start.
Delete the C:\Program Files\nodejs
manually. The problem will not occur (untill reboot?).
You need to manually uninstall your global node.js. Then use only nvm to manage your node versions (nvm on, nvm install, nvm use)
Run with administrator privileges
You need to manually uninstall your global node.js. Then use only nvm to manage your node versions (nvm on, nvm install, nvm use)
Yes, this fixes the issue.
But some feedback to the end user would be nice when this error occurs.
Run with administrator privileges
I think this is a good way of letting nvm
to change node
to another version. However, if you change the version, close the windows command line, git-bash or whatever terminal tool you are using then if you open it again without Admin Privileges you'll see that node
version will be the last one you've changed with admin privileges.
This is a duplicate of #472. I've also registered issue #494 to add better messaging when there is a conflict in the Node PATH.
Most helpful comment
You need to manually uninstall your global node.js. Then use only nvm to manage your node versions (nvm on, nvm install, nvm use)