Nvm-windows: Switching to another version fails scilently

Created on 23 Aug 2019  ·  5Comments  ·  Source: coreybutler/nvm-windows

My Environment

  • [X] Windows 10

I'm using NVM4W version:

  • [X] 1.1.7

I have already...

  • [X] read the README to be aware of npm gotchas & antivirus issues.
  • [X] reviewed the wiki to make sure my issue hasn't already been resolved.
  • [X] verified I'm using an account with administrative privileges.
  • [ ] searched the issues (open and closed) to make sure this isn't a duplicate.
  • [ ] made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • [ ] settings.txt
  • [ ] proxy support (Have you tried version 1.1.0+?)
  • [ ] 32 or 64 bit support (Have you tried version 1.1.3+?)
  • [ ] Character escaping (Have you tried version 1.1.6+?)
  • [X] A standard shell environment (terminal/powershell)
  • [ ] A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Expected Behavior

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.

Actual Behavior

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

Steps to reproduce the problem:

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.

Workaround

Delete the C:\Program Files\nodejs manually. The problem will not occur (untill reboot?).

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)

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings