搞node,要啥nvm啊? Node版本进展迅猛,不一样的工程能够支持不一样的node版本,若是安装的node版本和工程支持的不一样,就须要费时费力的调试了.
nvm用于在电脑上同时安装多个node版本,项目用哪一个就切换到哪一个,是否是很方便呢?node
The npm/Microsoft/Google recommended Node.js version manager for Windows.
NVM的官网介绍,是NPM官方/微软/谷歌推荐的Windows 上node版本管理工具,就问你牛不牛??git
nvm下载地址 直接github下载下来. 写文章时版本为1.17,也能够直接点击下载github
nvm1.17下载包shell
下载完,点击安装便可.npm
建议将nvm以及node的路径指定为非默认路径,这样后面维护好找些.windows
为了使用nvm正常管理node,须要先卸载以前安装的任何node版本. 旧的不去新的不来🐎.工具
安装完成后,从新打开一个powershell或者cmd窗口,执行nvm就能够了this
E:\codes λ nvm list No installations recognized. E:\codes
能够看到nvm命令能够正常的运行了,先安装个node 8.x版本看看调试
E:\codes λ nvm install 8.16.0 Downloading node.js version 8.16.0 (64-bit)... Complete Creating E:\node\nvm\temp Downloading npm version 6.4.1... Complete Installing npm v6.4.1... Installation complete. If you want to use this version, type nvm use 8.16.0 E:\codes λ nvm use 8.16.0 Now using node v8.16.0 (64-bit) E:\codes λ node --version v8.16.0 E:\codes
库上有哪些版本能够使用呢,一行命令能够方便的得知:code
E:\codes λ nvm list available | CURRENT | LTS | OLD STABLE | OLD UNSTABLE | |--------------|--------------|--------------|--------------| | 13.12.0 | 12.16.1 | 0.12.18 | 0.11.16 | | 13.11.0 | 12.16.0 | 0.12.17 | 0.11.15 | | 13.10.1 | 12.15.0 | 0.12.16 | 0.11.14 | | 13.10.0 | 12.14.1 | 0.12.15 | 0.11.13 | | 13.9.0 | 12.14.0 | 0.12.14 | 0.11.12 | | 13.8.0 | 12.13.1 | 0.12.13 | 0.11.11 | | 13.7.0 | 12.13.0 | 0.12.12 | 0.11.10 | | 13.6.0 | 10.19.0 | 0.12.11 | 0.11.9 | | 13.5.0 | 10.18.1 | 0.12.10 | 0.11.8 | | 13.4.0 | 10.18.0 | 0.12.9 | 0.11.7 | | 13.3.0 | 10.17.0 | 0.12.8 | 0.11.6 | | 13.2.0 | 10.16.3 | 0.12.7 | 0.11.5 | | 13.1.0 | 10.16.2 | 0.12.6 | 0.11.4 | | 13.0.1 | 10.16.1 | 0.12.5 | 0.11.3 | | 13.0.0 | 10.16.0 | 0.12.4 | 0.11.2 | | 12.12.0 | 10.15.3 | 0.12.3 | 0.11.1 | | 12.11.1 | 10.15.2 | 0.12.2 | 0.11.0 | | 12.11.0 | 10.15.1 | 0.12.1 | 0.9.12 | | 12.10.0 | 10.15.0 | 0.12.0 | 0.9.11 | | 12.9.1 | 10.14.2 | 0.10.48 | 0.9.10 | This is a partial list. For a complete list, visit https://nodejs.org/download/release
再安装个新的 12.12版本看看,为何安装这个版本? 由于这个版本号好记...
λ nvm install 12.12.0 Downloading node.js version 12.12.0 (64-bit)... Complete Creating E:\node\nvm\temp Downloading npm version 6.11.3... Complete Installing npm v6.11.3... Installation complete. If you want to use this version, type nvm use 12.12.0 E:\codes λ nvm use 12.12.0 Now using node v12.12.0 (64-bit) E:\codes λ node --version v12.12.0 E:\codes λ nvm use 8.16.0 Now using node v8.16.0 (64-bit) E:\codes λ node --version v8.16.0 E:\codes λ
能够看到 nvm use 能够随意的切换node 版本,真是太方便了!!!
走过路过不错过,这里就是子午哥;追根究底寻根源,问题解决没的说
本篇文章由一文多发平台 PDArtPub自动发布
本篇文章由一文多发平台PDArtPub自动发布