当前位置:网站首页>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
边栏推荐
- Pytorch代码注意的细节,容易敲错的地方
- [string] palindrome string of codeup
- MySQL advanced learning summary 9: create index, delete index, descending index, and hide index
- [force buckle]43 String multiplication
- UCF(暑期团队赛二)
- [detailed explanation of Huawei machine test] statistics of shooting competition results
- ArcGIS application foundation 4 thematic map making
- PDK工藝庫安裝-CSMC
- 【华为机试真题详解】检查是否存在满足条件的数字组合
- 【torch】|torch.nn.utils.clip_grad_norm_
猜你喜欢
Deep learning -yolov5 introduction to actual combat click data set training
PDK工藝庫安裝-CSMC
Using stopwatch to count code time
ArcGIS应用基础4 专题图的制作
【SQL server速成之路】——身份驗證及建立和管理用戶賬戶
JS array list actual use summary
Zoom and pan image in Photoshop 2022
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
26file filter anonymous inner class and lambda optimization
02. Develop data storage of blog project
随机推荐
Jvxetable用slot植入j-popup
01. 开发博客项目之项目介绍
RustDesk 搭建一个自己的远程桌面中继服务器
03. 开发博客项目之登录
How to get list length
Knowledge points of circular structure
Vulhub vulnerability recurrence 73_ Webmin
Game push image / table /cv/nlp, multi-threaded start
Configuration file converted from Excel to Lua
SequoiaDB湖仓一体分布式数据库2022.6月刊
Qt TCP 分包粘包的解决方法
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
Promise summary
初识CDN
01. Project introduction of blog development project
26file filter anonymous inner class and lambda optimization
数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
Codeforces Round #804 (Div. 2) Editorial(A-B)
B站刘二大人-Softmx分类器及MNIST实现-Lecture 9
HAC cluster modifying administrator user password