nvm-windows
nvm-windows copied to clipboard
Issue with special characters in user folder breaks installation of npm
Issue: In Windows Terminal (both with Powershell 11 and cmd) fail to install npm if the path C:\Users<UserFolder>\AppData\Roaming\nvm contains special characters Example C:\Users\JakubN�rl�vIwanczuk\AppData\Roaming\nvm
I have installed other software in the personal folder without any issue.
How To Reproduce:
- Install windows-nvm
- Open "Windows Terminal"
- Run
nvm install 16.18.1
Expected Behavior: Install of NPM version 16.18.1
Screenshots:
Additional context
Folder structure with special characters
Desktop:
- OS: Windows 11
A fix seems to be to correct the C:\Users\<UserFolder>\AppData\Roaming\nvm\settings.txt
file as it is the one containing incorrect characters. After that change I was able to install NPM using nvm
Is this using v1.1.10?
I think this is related to #726 and #821. Unfortunately, I don't have a good way to troubleshoot this with the versions of Windows I currently have available. Until I do, the best solution I can suggest is to install in different directory, such as C:\nvm4w
.
Hi @coreybutler Thanks for the reply.
Yes it is version 1.1.10.
As I wrote in my comment you can get around this error by editing the settings.txt file. So the error originates from an (probably) encoding error when the settings.txt file is written.
Issue #726 could seem related, but I had no problems envoking nvm-windows, just with installing npm due to special characters in my Windows user name. As to #821 I do not know.
Hope this helps \Jakub
I have the same issue:
Silvère LESTANG@VAL-SW-032 MINGW64 ~
$ nvm install 16.19.0
C:\Users\Silv�re LESTANG\AppData\Roaming\nvm could not be found or does not exist. Exiting.
Downloading node.js version 16.19.0 (64-bit)...
Error while creating C:\Users\Silv�re LESTANG\AppData\Roaming\nvm\v16.19.0\node.zip - open C:\Users\Silv�re LESTANG\AppData\Roaming\nvm\v16.19.0\node.zip: The system cannot find the path specified.
Could not download node.js v16.19.0 64-bit executable.
I change the encoding of settings.txt from ANSI to UTF-8, fix the accent on my name, and now nvm install works fine, but not nvm use :
Silvère LESTANG@VAL-SW-032 MINGW64 ~
$ nvm install 16.19.0
Downloading node.js version 16.19.0 (64-bit)...
Extracting node and npm...
Complete
npm v8.19.3 installed successfully.
Installation complete. If you want to use this version, type
nvm use 16.19.0
Silvère LESTANG@VAL-SW-032 MINGW64 ~
$ nvm use 16.19.0
exit status 1: 'C:\Users\Silv�re' is not recognized as an internal or external command,
operable program or batch file.
I am on Windows 11 with mvn 1.1.10
Same problem here, but user contains a few period+space sequences, thusly:
c:\users\dr. dennis w. neder\ ... resulting in:
nvm use 16.20.0 exit status 1: 'C:\Users\Dr.' is not recognized as an internal or external command, operable program or batch file.
exit status 1: 'C:\Users\Dr.' is not recognized as an internal or external command, operable program or batch file.
Note: I tried updating ...\AppData\Roaming\nvm\Settings.txt to use:
root: ":\Users\Dr. Dennis W. Neder\AppData\Roaming\nvm"
to no avail.
Oh, and using Win 11 with nvm vers. 1.1.11
Same as @dwneder I have a space in the name. Same message (except for the Dr. part, that's not my name 😄)