9

My issue is related to this problem from 3 years ago. nvm-windows fails when the user path contains a space However, none of these solution help me. My user folder name is Sunita Dahal. I successfully installed nvm, I can use nvm install as well as nvm list. But when I try to do nvm use <version> it throws me

C:\Users\Sunita Dahal>nvm use 8.0.0
exit status 1: 'C:\Users\Sunita' is not recognized as an internal or external command,
operable program or batch file.

I have also updated my system path variables. enter image description here

I also had installed node previously. that is why I have the path C:\Users\Sunita Dahal\AppData\Roaming\npm.

E_net4
  • 27,810
  • 13
  • 101
  • 139
rakesh shrestha
  • 1,335
  • 19
  • 37

4 Answers4

16

I fixed this issue by updating the settings.txt in nvm to C:/Sunita~1/AppData/roaming/nvm. More about it on https://github.com/coreybutler/nvm-windows/issues/41

rakesh shrestha
  • 1,335
  • 19
  • 37
7

To add precisions to Rey young answer :

You should In cmd, go to c:\users and type dir/x to see the shortened name for Sunita Dahal folder.

My name is Dan Cissokho and I got DANCIS~1 Then replace your user name with this shortened name in the setting.txt.

That's it.

enter image description here

Dan M. CISSOKHO
  • 1,070
  • 1
  • 12
  • 27
0

There is no need for such hacks, I spent several hours trying to figure this out and none of these solutions work for me.

What I ended up doing was to install the nvm in c:\tools\ directory, you might already have one if not just create it. The point it, just install the nvm in a short path without spaces.

Adil H. Raza
  • 1,649
  • 20
  • 25
0

None of solution worked, you were able to resolve the issue by moving the nvm folder to another directory and updating the path in the environment variable settings and settings.txt file within nvm.

Your solution of relocating the nvm folder and updating the relevant configuration files is a valid approach to handle situations where spaces in directory paths cause issues with certain commands or tools.