Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with special characters in user folder breaks installation of npm #887

Open
jakub-i opened this issue Nov 22, 2022 · 6 comments
Open

Comments

@jakub-i
Copy link

jakub-i commented Nov 22, 2022

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:

  1. Install windows-nvm
  2. Open "Windows Terminal"
  3. Run nvm install 16.18.1

Expected Behavior:
Install of NPM version 16.18.1

Screenshots:
image

Additional context
image
Folder structure with special characters

Desktop:

  • OS: Windows 11
@jakub-i
Copy link
Author

jakub-i commented Nov 22, 2022

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

@coreybutler
Copy link
Owner

coreybutler commented Nov 23, 2022

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.

@jakub-i
Copy link
Author

jakub-i commented Nov 23, 2022

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

@github-actions github-actions bot added the Stale Stale label Dec 24, 2022
@coreybutler coreybutler removed the Stale Stale label Dec 24, 2022
Repository owner deleted a comment from github-actions bot Dec 24, 2022
@slestang
Copy link

slestang commented Jan 6, 2023

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

@dwneder
Copy link

dwneder commented May 25, 2023

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

@RWOverdijk
Copy link

Same as @dwneder I have a space in the name. Same message (except for the Dr. part, that's not my name 😄)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants