目录
1、不存在Node.js环境时,下载Node.js latest最新版本并设置为全局Node.js 。
2、升级本地Node.js latest最新版本。
3、查看本地Node.js global全局安装版本和latest最新版本。
4、验证 .gnvmrc registry 正确性。
5、本地不存在npm时,安装当前Node.js版本对应的npm版本。
6、安装npm latest最新版本。
7、Node多版本管理器gnvm切换node版本The process cannot access the file because it is being used by another process
gnvm config registry TAOBAO
c:\> gnvm config registry TAOBAO
Set success, registry new value is http://npm.taobao.org/mirrors/node/
gnvm install latest -g
c:\> gnvm install latest -g
Notice: local latest version is unknown.
Notice: remote latest version is 5.10.1.
Start download Node.js versions [5.10.1].
5.10.1: 100% [==================================================>] 13s
End download.
Set success, latestversion new value is 5.10.1
Set success, global Node.js version is 5.10.1.
gnvm update latest
c:\> gnvm config registry TAOBAO
Set success, registry new value is http://npm.taobao.org/mirrors/node/
c:\> gnvm update latest
Notice: local Node.js latest version is 5.9.1.
Notice: remote Node.js latest version is 5.10.1 from http://npm.taobao.org/mirrors/node/.
Waring: remote latest version 5.10.1 > local latest version 5.9.1.
Waring: 5.10.1 folder exist.
Update success, Node.js latest version is 5.10.1.
gnvm node-version
c:\> gnvm node-version
Node.js latest version is 5.10.1.
Node.js global version is 5.10.1.
gnvm config registry test
c:\> gnvm config registry test
Notice: gnvm config registry http://npm.taobao.org/mirrors/node/ valid ................... ok.
Notice: gnvm config registry http://npm.taobao.org/mirrors/node/index.json valid ......... ok.
gnvm npm global
c:\ gnvm npm global
Waring: current path C:\xxx\xxx\nodejs\ not exist npm.
Notice: local npm version is unknown
Notice: remote npm version is 3.8.3
Notice: download 3.8.3 version [Y/n]? y
Start download new npm version v3.8.3.zip
v3.8.3.zip: 100% [==================================================>] 4s
Start unzip and install v3.8.3.zip zip file, please wait.
Set success, current npm version is 3.8.3.
c:\> npm -v
3.8.7
gnvm npm latest
c:\ gnvm npm latest
Notice: local npm version is 3.7.3
Notice: remote npm version is 3.8.7
Notice: download 3.8.7 version [Y/n]? y
Start download new npm version v3.8.7.zip
v3.8.7.zip: 100% [==================================================>] 3s
Start unzip and install v3.8.7.zip zip file, please wait.
Set success, current npm version is 3.8.7.
c:\> npm -v
3.8.7
https://blog.csdn.net/qq_38290251/article/details/130700169