Are you still switching node versions by downloading overlays?
Let me talk about the origin. At the beginning, when I only had one project in my hand, I found that the method of downloading and overwriting was quite easy to use.
But I never expected that the resignation season is coming, more than ten systems, thirty or forty terminals, to be developed simultaneously
This is nothing, the pain is that there are all versions of cli used to create projects,
Just finished developing a project and want to switch node
So, no more nonsense, I'll just start
One-click node version switching
download a tool
Nvm official website download address: Releases coreybutler/nvm-windows GitHub ,
Someone must be saying, I can’t download it, what’s wrong
Link: https://pan.baidu.com/s/1gUhAB7kJkfubWkgnudYPuQ Extraction code: e3au
The link is ready, download it yourself,
The installation method is also very simple, agree, then go crazy to the next step, and then restart the computer
But before installing, you should remember to look at your local node version
//查看node版本
node -v
After reading, install nvm
then you can
1,nvm nvm list 是查找本电脑上所有的node版本
- nvm list 查看已经安装的版本
- nvm list installed 查看已经安装的版本
- nvm list available 查看网络可以安装的版本
2,nvm install 安装最新版本nvm
3,nvm use <version> ## 切换使用指定的版本node
4,nvm ls 列出所有版本
5,nvm current显示当前版本
6,nvm alias <name> <version> ## 给不同的版本号添加别名
7,nvm unalias <name> ## 删除已定义的别名
8,nvm reinstall-packages <version> ## 在当前版本node环境下,重新全局安装指定版本号的npm包
9,nvm on 打开nodejs控制
10,nvm off 关闭nodejs控制
11,nvm proxy 查看设置与代理
12,nvm node_mirror [url] 设置或者查看setting.txt中的node_mirror,如果不设置的默认是 https://nodejs.org/dist/
nvm npm_mirror [url] 设置或者查看setting.txt中的npm_mirror,如果不设置的话默认的是: https://github.com/npm/npm/archive/.
13,nvm uninstall <version> 卸载制定的版本
14,nvm use [version] [arch] 切换制定的node版本和位数
15,nvm root [path] 设置和查看root路径
16,nvm version 查看当前的版本
Change the project at will, and change the local node as well
One-click npm mirror switching
Now you won't still be using
npm config set registry http://registry.npm.taobao.org
Go to the code to switch the mirror position
What do you do if this mirror image is not available?
Let's stop talking nonsense and talk about tools
nrm
installation method
npm install -g nrm
The method of use and nvm are the same as the first one,,,
nrm ls 查看本地有哪些可以切换的镜像地址
nrm use 要切换的名称
nrm add zpm http://localhost:4873/ 添加自己的镜像地址
nrm test 测试相应源的响应时间。
nrm del 删除对应的源