Detailed explanation of the use of nvm
nvm, the full name of Node Version Manager, that is, node version control;
Usage scenario: When you are developing two or more node projects at the same time, and the node versions of these projects are different, nvm can help you manage the node version switching on your pc very well.
2. Download:
nvm下载链接
注:下载文件名为 nvm-setup.zip 的链接
3. Installation:
默认安装:安装nvm时候,全默认即可(如果自定义目录,切记 nvm的安装路径 :不要有汉字,不要有空格,不然后面会出现乱码问题);
自定义安装:打开安装包,选择nvm的存放路径,以及nodejs的存放路径,这里切记不要选择到c:/program files,这里的两个路径是为了自动在系统中添加环境变量的路径;
4. Set up proxy
打开nvm文件夹下的settings.txt文件,在最后添加以下代码:
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
将下载镜像源指向淘宝(这步也很重要,否则在安装node的时候会出现卡死,npm安装不成功的情况)
5. Use:
安装指定版本的node,比如:
在cmd上输入 nvm install 6.9.5
6. Some common instructions about nvm
nvm version // 查看nvm版本
nvm install 4.6.2 // 安装node4.6.2版本(附带安装npm)
nvm uninstall 4.6.2 // 卸载node4.6.2版本
nvm list // 查看node版本
nvm use 4.6.2 // 将node版本切换到4.6.2版本
nvm root // 查看nvm安装路径
nvm install latest //下载最新的node版本和与之对应的npm版本
1, nvm nvm list is to find all the node versions on this computer
nvm list 查看已经安装的版本
nvm list installed 查看已经安装的版本
nvm list available 查看网络可以安装的版本
2, nvm install installs the latest version of nvm
3,nvm use ## Switch to use the specified version node
4, nvm ls lists all versions
5, nvm current displays the current version
6, nvm alias ## Add aliases to different version numbers
7,nvm unalias ## Delete the defined alias
8,nvm reinstall-packages ## In the current version of node environment, reinstall the npm package of the specified version number globally
9, nvm on open nodejs control
10, nvm off close nodejs control
11, nvm proxy view settings and proxy
12, nvm node_mirror [url] Set or view node_mirror in setting.txt, if not set, the default is https://nodejs.org/dist/
nvm npm_mirror [url] Set or view npm_mirror in setting.txt, if not set, the default is: https://github.com/npm/npm/archive/.
13, nvm uninstall uninstall the developed version
14, nvm use [version] [arch] Switch the specified node version and bit number
15, nvm root [path] set and view the root path
16, nvm version view the current version
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。