1.下载安装
nvm安装下载: Releases · coreybutler/nvm-windows · GitHub
安装遇到的问题:
安装时修改nvm和node的默认路径
运行node install 16.20.0 可能会出现以下报错:
Downloading node.js version 16.20.0 (64-bit)...
Error while creating D:\nvm\v16.20.0\node.zip - open D:\nvm\v16.20.0\node.zip: The system cannot find the path specified.
Could not download node.js v16.20.0 64-bit executable.
后来尝试卸载重新安装,路径不修改,在运行,无问题;
(之后尝试,发现 需要 以管理员身份 运行)
2.常用命令:
获取所有可安装的node版本
nvm list available
查询已安装的node版本
nvm list
安装指定版本的 Node.js
nvm install 16.20.0
指定当前要使用的 Node.js 版本,只用指定使用的 Node.js 版本后,nodejs 的才真正安装了。
nvm use 16.20.0
卸载某个 Node.js 版本
nvm uninstall 16.20.0
显示当前使用版本
nvm current
3.webstorm运行项目是node配置
编辑配置
节点选择器
添加路径
默认路径: C:\Users\Administrator\AppData\Roaming\nvm
之后重启电脑