Nvm-windows: exit status 1

Created on 26 Jan 2018  ·  4Comments  ·  Source: coreybutler/nvm-windows

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.

My Environment

  • [ ] Windows 7 or below (not truly supported due to EOL - see wiki for details)
  • [ ] Windows 8
  • [ ] Windows 8.1
  • [ x ] Windows 10
  • [ ] Windows 10 IoT Core
  • [ ] Windows Server 2012
  • [ ] Windows Server 2012 R2
  • [ ] Windows Server 2016

  • [ ] My Windows installation is non-English.

I'm using NVM4W version:

  • [x ] 1.1.6
  • [ ] 1.1.5
  • [ ] 1.1.4
  • [ ] 1.1.3
  • [ ] 1.1.2
  • [ ] 1.1.1
  • [ ] Older
  • [ ] OTHER (Please Specify)

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.
  • [ ] 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+?)
  • [ ] A standard shell environment (terminal/powershell)
  • [ ] A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Expected Behavior

Fill me in...

Actual Behavior

exit status 1: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Steps to reproduce the problem:

  • I install the noinstall-setup.exe
  • set settings.txt at C:.
  • nvm install 8.9.4
  • nvm use 8.9.4 ( error occured )

Most helpful comment

Edit file

C:\Users\User Name\AppData\Roaming\nvm\settings.txt

Change

root: C:\Users\User Name\AppData\Roaming\nvm
path: C:\Program Files\nodejs

To

root: C:\Users\UserNa~1\AppData\Roaming\nvm
path: C:\Progra~1\nodejs

The idea is to remove spaces from User Name to UserName and delete last letters so that with ~1 at the end there was 8 letters.
So
UserName~1 - 10 letters
UserNa~1 - 8 letters
That solved my problem.
It seems nvm does not support spaces in its own configuration file that it makes by itself by default.
Many users have spaces in their windows account name.
This is a BUG.

All 4 comments

Windows files systems allows spaces... in paths.. seems to be the issue.
Did you try to install on a different location?

It looks like some quotes are missing in the bat files.

Solved it by installing it in other Destination folder and the Set Node.js Symlink path does not contain any spaces

Edit file

C:\Users\User Name\AppData\Roaming\nvm\settings.txt

Change

root: C:\Users\User Name\AppData\Roaming\nvm
path: C:\Program Files\nodejs

To

root: C:\Users\UserNa~1\AppData\Roaming\nvm
path: C:\Progra~1\nodejs

The idea is to remove spaces from User Name to UserName and delete last letters so that with ~1 at the end there was 8 letters.
So
UserName~1 - 10 letters
UserNa~1 - 8 letters
That solved my problem.
It seems nvm does not support spaces in its own configuration file that it makes by itself by default.
Many users have spaces in their windows account name.
This is a BUG.

Also this superuser answer is valuable as work-around supplementary.

I ran into this with the latest version and the only way I could get it to work was install to C:\nvm and symlink at C:\nodejs

Was this page helpful?
0 / 5 - 0 ratings