Nvm-windows: 切换版本时获取“退出状态 1:'C:\Program' 未被识别为内部或外部命令”

创建于 2016-05-12  ·  11评论  ·  资料来源: coreybutler/nvm-windows

我已经在“C:\Program Files\nvm”中安装了 v1.1.0。 一切都很好,但是当我尝试切换到已安装的版本时,我得到:

C:\WINDOWS\system32>nvm use 5.10.1
exit status 1: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
duplicate

最有用的评论

问题在于 URL(C:\Program Files) 中的空格。 尝试将 nvm 直接安装在 C:/ 或 PATH 中没有空格的其他文件夹中。

所有11条评论

问题在于 URL(C:\Program Files) 中的空格。 尝试将 nvm 直接安装在 C:/ 或 PATH 中没有空格的其他文件夹中。

是的,但那是:))。

重复#41。

视窗

移动到没有空格的路径

或者

以管理员身份运行cmd
然后将它 mklink 到没有空格的新路径。

我的一位用户遇到了同样的问题。 但是,将 nvm 移动到另一个文件夹对我们不起作用,因为我们的安全策略不允许我们在 Program Files 或 Program Files (x86) 文件夹之外运行应用程序。 如果代码允许它在带有空格的目录中运行,那将会很有帮助。

更改节点版本的根目录(无空格)
然后你可以安装那里的节点并使用它
例子:
nvm root C:\nodejs\nvm
nvm install 10.0.0
nvm use 10.0.0

问题很旧,但对于任何登陆这里的人,您都可以如上所述重新安装 nvm,
或者使用短路径。 用nvm root C:\PROGRA~1\nvm改变C:\Program Files\nvm nvm root C:\PROGRA~1\nvm
可能还想对 NVM_SYMLINK 使用 shortPath : C:\Program Files\nodejsC:\PROGRA~1\nodejs

您在安装过程中更改了默认路径。
我卸载了 nvm,并使用默认路径安装了它,一切正常。

问题在于 URL(C:\Program Files) 中的空格。 尝试将 nvm 直接安装在 C:/ 或 PATH 中没有空格的其他文件夹中。

是的,这是工作,谢谢:)

所以如果我拿到电脑的时候在我的名字里加一个空格,我就永远完蛋了,是吧?

更好的解决方案是: https :

Open Cmd, go to the Users directory, type dir /x and you will see the shortened version of the name of the users. (ALEXKA~1 in my case)
Inside the nvm installation (AppData\Roaming\nmv in my case) there is a settings file, edit the first line and instead of having the space name put that shortened version and leave the rest the same like this :
root: C:\Users\ALEXKA~1\AppData\Roaming\nvm

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

SufyanParkar picture SufyanParkar  ·  4评论

David263 picture David263  ·  3评论

petrovicz picture petrovicz  ·  4评论

martijnsenden picture martijnsenden  ·  3评论

AllainPL picture AllainPL  ·  7评论