Nvm-windows: Getting "exit status 1: 'C:\Program' is not recognized as an internal or external command" when switching versions

Created on 12 May 2016  ·  11Comments  ·  Source: coreybutler/nvm-windows

I have installed v1.1.0 in "C:\Program Files\nvm". All good but when I'm trying to switch to a version I have installed I get:

C:\WINDOWS\system32>nvm use 5.10.1
exit status 1: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
duplicate

Most helpful comment

The problem is with the spaces in URL(C:\Program Files). Try to install the nvm directly in C:/ or in other folder without spaces in the PATH.

All 11 comments

The problem is with the spaces in URL(C:\Program Files). Try to install the nvm directly in C:/ or in other folder without spaces in the PATH.

Yes, but that is :)).

Duplicate of #41.

windows

move to path there without whitespace

or

running cmd as administrator
and then mklink it to the new path there without whitespace.

One of my users is having the same problem. However, moving nvm to another folder doesn't work for us, because our security policies don't allow us to run applications outside of Program Files or Program Files (x86) folders. It would be helpful if the code allowed it to run in a directory with spaces.

Change root directory for version of nodes (without spaces)
Then You can install there node and use it
Example:
nvm root C:\nodejs\nvm
nvm install 10.0.0
nvm use 10.0.0

Issue is old but for anyone that lands here you can reinstall nvm as mentioned above,
Or use short path. Changing C:\Program Files\nvm with nvm root C:\PROGRA~1\nvm
Might also want to use shortPath for NVM_SYMLINK : C:\Program Files\nodejs to C:\PROGRA~1\nodejs

You have changed the default path during installation.
I uninstalled nvm, and installed it with default paths, all works fine.

The problem is with the spaces in URL(C:\Program Files). Try to install the nvm directly in C:/ or in other folder without spaces in the PATH.

Yes, That's work thanks :)

So if I put a space in my name when I got the computer, I'm just screwed forever, huh?

a better solution is : https://github.com/coreybutler/nvm-windows/issues/405

Open Cmd, go to the Users directory, type dir /x and you will see the shortened version of the name of the users. (ALEXKA~1 in my case)
Inside the nvm installation (AppData\Roaming\nmv in my case) there is a settings file, edit the first line and instead of having the space name put that shortened version and leave the rest the same like this :
root: C:\Users\ALEXKA~1\AppData\Roaming\nvm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Deilan picture Deilan  ·  4Comments

webspecialist picture webspecialist  ·  5Comments

janpio picture janpio  ·  3Comments

fredericrous picture fredericrous  ·  3Comments

eliavmaman picture eliavmaman  ·  6Comments