在用户名包含空格的 Windows 中 nvm 使用失败

Rey*_*ung 1 nodes node.js npm nvm

我的问题与 3 年前的这个问题有关。 当用户路径包含空格时,nvm-windows 失败 但是,这些解决方案都没有帮助我。我的用户文件夹名称是Sunita Dahal. 我安装成功nvm,我可以使用nvm install,以及nvm list。但是当我尝试这样做时,nvm use <version>它让我感到困惑

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.
Run Code Online (Sandbox Code Playgroud)

我还更新了我的系统路径变量。 在此处输入图片说明

我之前也安装了节点。这就是为什么我有路径C:\Users\Sunita Dahal\AppData\Roaming\npm

DMC*_*KHO 8

为了增加 Rey young 答案的精确度:

您应该在 cmd 中转到c:\users并输入dir/x以查看Sunita Dahal文件夹的缩写名称。

我的名字是 Dan Cissokho,我有DANCIS~1 然后将您的用户名替换为 settings.txt 中的这个缩写名称。

就是这样。

在此输入图像描述


Rey*_*ung 5

我通过将settings.txtin更新nvmC:/Sunita~1/AppData/roaming/nvm. 更多关于https://github.com/coreybutler/nvm-windows/issues/41