当前位置:网站首页>Download, install and use NVM of node, and related use of node and NRM
Download, install and use NVM of node, and related use of node and NRM
2022-07-06 05:40:00 【zhuangwei_ eight thousand two hundred and fifty-six】
This article mainly introduces the relationship between these three , And their respective applications .
Attach the address as usual :
node
node, It mainly uses one npm Package management tools , It's also useful node Write background applications , This article mainly introduces node Of npm;
About what is npm Package management tools , I believe nothing is more authoritative than official documents , So about npm What's your introduction , Please check by yourself node Of npm Official documents
well , Get into the subject .
About node Installation , I believe most of them have no problem , It's all goofy installation ( Just click on the next step all the way )
It is worth noting that :
We're entering node When downloading the address , The choice is this Long term maintenance version , Don't choose the latest version , The long-term maintenance version is relatively stable , It is also recommended by the government to choose the long-term maintenance version ;
Download normally node After installing the package , Direct installation . I won't say much here .
nrm
installed node, after window + r
Input cmd
Get into ‘ Black window ’ Enter the command :node --version
View installed node edition
See the displayed version number , Express node Installation successful ;
So what is nrm?
nrm It's a npm Network speed management tool , because npm By default, all downloads are through foreign websites , So we need to install another nrm Network speed management tool to switch the image source to improve our npm Download speed :
npm i nrm -g
Test for successful installation , Enter the following command on the command line to verify the version number , If the version number appears, the installation is successful :
nrm --version
Then use nrm Check which image source has a faster network speed ( It will take a while to test ), Enter the following command at the command line :
nrm test
After a while, the command line displays :
In front of you * Represents the image source you are currently using ;
explain :taobao Our servers are in China , Therefore, it is faster to download and use the image source , Here I have switched ;
How to switch the image source :
nrm use Name of the image source
// Example
nrm use taobao
in addition , You can also use cnpm Download tools to download , Function and npm It's the same ;
// Global installation cnpm
npm install cnpm -g
Whether to use cnpm Installation tools ,IT Opinions vary in the world , I won't say much here .
nvm
I don't know if you found out after joining the company , Used in previous projects of the company node Version and existing node The versions are quite different , It may lead to the use of a new version node Unable to start and run the old project of the packaging company normally ;
that ,nvm coming , What is? nvm?nvm(node version management) node version management , seeing the name of a thing one thinks of its function ,nvm It's actually a management node Version of a tool , With this tool , We can install multiple node edition , You can switch the desired one according to different items at will node edition ;
After entering the website of the download address , One thing to note is not to use the latest version :
To download the maintenance version :
After decompression, click the installation package to install :
This is nvm Installation path for ;
This is nvm Corresponding node route , Note here that if you installed node, Also hope that before node Version for this nvm Words of management , This node The path needs to be the same as the previous node The path is the same ;
Click Next here , If it was installed before node , Will prompt : Detected that node xx.xx.xx, you hope nvm Control this version ?
Click is , Then the normal installation succeeds :
testing nvm Is the installation successful :
Next , adopt nvm Install different versions of node:
nvm install 16.15.1
Install one more :
nvm install 14.4.0
View installed node list
nvm list
// perhaps
nvm ls
Then switch to normal use node Just use version ,
nvm use 14.4.0
And then use npm command , It turned out that the report was wrong :npm Not an internal command ……
That's because the top passes nvm install node 14.4.0 At version time Installed npm Wrong report !!!
Check it out. nvm Path folder :
Results found ,node 16.15.1 There are npm command ,node 14.4.0 Of them, there is no :
Solution 1 :
direct nvm Download the file again node Version can ;Solution 2 :
Go to npm Mirror website Download the corresponding version , Unzip to node_modules And changed his name to npm, Go to this folder , take bin In the folder npm、npm.cmd、npx、npx.cmd Copy the four files to the corresponding node Version folder ;
I do not know! node The version corresponds to npm How many versions can you check :node Previous versions
After that , It is suggested that nvm Of the installation path ofsettings.txt
Add to file : This step is mainly to npm Change the image to Taobao's image , Can increase the download speed . It can also be done through nvm Command to set these addresses , At the end of the article, there is an introduction to the relevant commands , There will be no demonstration here .
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
Prepare it later nvm Common commands :
nvm list
: View the installed node editionnvm ls
: List all node editionnvm version
: View the current nvm editionnvm install <version>
: Install the specified node editionnvm use <version>
: Switch to use the specified node editionnvm uninstall <version>
: Uninstall the specified node editionnvm current
: Displays the current node editionnvm alias <name> <version>
: To different node Add an alias to the version numbernvm unalias <name>
: Delete the defined aliasnvm on
: open nodejs controlnvm off
: close nodejs controlnvm proxy
: View settings and agentsnvm node_mirror [url]
: Set or view setting.txt Medium node_mirror, If not set, the default is https://nodejs.org/dist/nvm npm_mirror [url]
: Set or view setting.txt Medium npm_mirror, If not set, the default is : https://github.com/npm/npm/archive/.nvm use [version] [arch]
: Switch the settings node Version and number of digitsnvm root [path]
: Set up and view root route
边栏推荐
- 清除浮动的方式
- C AES encrypts strings
- ArcGIS application foundation 4 thematic map making
- Qt TCP 分包粘包的解决方法
- PDK工藝庫安裝-CSMC
- Sequoiadb Lake warehouse integrated distributed database, June 2022 issue
- 【经验】UltralSO制作启动盘时报错:磁盘/映像容量太小
- Game push image / table /cv/nlp, multi-threaded start
- LeetCode_字符串反转_简单_557. 反转字符串中的单词 III
- Vulhub vulnerability recurrence 72_ uWSGI
猜你喜欢
RustDesk 搭建一个自己的远程桌面中继服务器
网站进行服务器迁移前应做好哪些准备?
Text classification still stays at Bert? The dual contrast learning framework is too strong
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
05. 博客项目之安全
Rustdesk builds its own remote desktop relay server
嵌入式面试题(四、常见算法)
Game push image / table /cv/nlp, multi-threaded start
Redis message queue
02. Develop data storage of blog project
随机推荐
[imgui] unity MenuItem shortcut key
jdbc使用call调用存储过程报错
C进阶-数据的存储(上)
Vulhub vulnerability recurrence 69_ Tiki Wiki
04. Project blog log
Vulhub vulnerability recurrence 73_ Webmin
js Array 列表 实战使用总结
嵌入式面试题(四、常见算法)
Sequoiadb Lake warehouse integrated distributed database, June 2022 issue
ARTS Week 25
Application Security Series 37: log injection
Vulhub vulnerability recurrence 67_ Supervisor
B站刘二大人-线性回归及梯度下降
Web Security (VI) the use of session and the difference between session and cookie
04. 项目博客之日志
无代码六月大事件|2022无代码探索者大会即将召开;AI增强型无代码工具推出...
Selective parameters in MATLAB functions
Promotion hung up! The leader said it wasn't my poor skills
Redis message queue
AUTOSAR从入门到精通番外篇(十)-嵌入式S19文件解析