nodejs管理工具nvm安装过程详解

Bertha ·
更新时间:2024-09-20
· 101 次阅读

nvm

nvm负责管理多个版本的nodejs

安装:

https://github.com/coreybutler/nvm-windows/releases
下载nvm-setup.zip,nvm-noinstall.zip

点击nvm-setup.exe安装,一路下一步,这里安装到C:\dev\nvm,安装完成后自动配置了环境变量:NVM_HOME,NVM_SYMLINK,也会添加到Path

验证是否安装成功,打开命令行cmd

nvm常用的命令

 nvm list 查看当前安装的Node.js所有版本号
nvm install 版本号 安装指定版本的Node.js
nvm uninstall 版本号 卸载指定版本的Node.js
nvm use 版本号 选择指定版本的Node.js

命令案例操作 # 安装7.10.0版本 C:\Users\vagrant>nvm install 7.10.0 Downloading node.js version 7.10.0 (64-bit)... Complete Creating C:\dev\nvm\temp Downloading npm version 4.2.0... Complete Installing npm v4.2.0... Installation complete. If you want to use this version, type nvm use 7.10.0 # 安装6.10.3版本 C:\Users\vagrant>nvm install 6.10.3 Downloading node.js version 6.10.3 (64-bit)... Complete Creating C:\dev\nvm\temp Downloading npm version 3.10.10... Complete Installing npm v3.10.10... Installation complete. If you want to use this version, type nvm use 6.10.3 # 显示当前已经安装的版本 C:\Users\vagrant>nvm list 7.10.0 6.10.3 C:\Users\vagrant> # 切换到7.10.0版本 C:\Users\vagrant>nvm use 7.10.0 Now using node v7.10.0 (64-bit) C:\Users\vagrant>nvm list * 7.10.0 (Currently using 64-bit executable) 6.10.3 # 查看当前使用的nodejs版本 C:\Users\vagrant>node -v v7.10.0 # 切换版本 C:\Users\vagrant>nvm use 6.10.3 Now using node v6.10.3 (64-bit) C:\Users\vagrant>nvm list 7.10.0 * 6.10.3 (Currently using 64-bit executable)

切换版本本质是是切换快捷方式

以上就是nodejs管理工具nvm安装过程详解的详细内容,更多关于nodejs nvm安装的资料请关注软件开发网其它相关文章!



nvm

需要 登录 后方可回复, 如果你还没有账号请 注册新账号