node.js 如何使用 nvm 更改节点版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/53785383/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 18:56:23  来源:igfitidea点击:

How to change node version with nvm

node.jsnvm

提问by Billy DEKAR

i'm using yeoman to create a project, when i try to use gulp i run the cmd : gulp servean error tells me that i need an older version of node (8.9.4), knowing that i've installed the latest version (10.14.1).

我正在使用 yeoman 创建一个项目,当我尝试使用 gulp 时,我运行了 cmd:gulp serve一个错误告诉我我需要旧版本的节点(8.9.4),知道我已经安装了最新版本(10.14) .1)。

So i installed nvm to change the node version, i had to set it into path C:\, then i run with success : nvm install 8.9.4and when i try to use it : nvm use 8.9.4, its always the latest version that is used

所以我安装了 nvm 来更改节点版本,我必须将它设置为路径C:\,然后我成功运行:nvm install 8.9.4当我尝试使用它时:nvm use 8.9.4它总是使用的最新版本

enter image description here

在此处输入图片说明

if i try to use 8.10.0, then run node -vit tells me access refused, same to any node command

如果我尝试使用 8.10.0,然后运行node -v它会告诉我访问被拒绝,与任何节点命令相同

回答by Dervi? Kay?mba??o?lu

you need to use

你需要使用

nvm use 8.10.0

note that you need to run this command as administrator

请注意,您需要以管理员身份运行此命令