当前位置:网站首页>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
边栏推荐
- Sword finger offer II 039 Maximum rectangular area of histogram
- 毕业设计游戏商城
- B站刘二大人-线性回归及梯度下降
- 剑指 Offer II 039. 直方图最大矩形面积
- Web Security (V) what is a session? Why do I need a session?
- Game push image / table /cv/nlp, multi-threaded start
- Redis message queue
- HAC集群修改管理员用户密码
- How can large websites choose better virtual machine service providers?
- [QNX hypervisor 2.2 user manual]6.3.3 using shared memory (shmem) virtual devices
猜你喜欢
PDK工藝庫安裝-CSMC
Deep learning -yolov5 introduction to actual combat click data set training
Codeless June event 2022 codeless Explorer conference will be held soon; AI enhanced codeless tool launched
27io stream, byte output stream, OutputStream writes data to file
ArcGIS application foundation 4 thematic map making
Text classification still stays at Bert? The dual contrast learning framework is too strong
无代码六月大事件|2022无代码探索者大会即将召开;AI增强型无代码工具推出...
Cuda11.1 online installation
Game push image / table /cv/nlp, multi-threaded start
First acquaintance with CDN
随机推荐
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
B站刘二大人-多元逻辑回归 Lecture 7
【华为机试真题详解】检查是否存在满足条件的数字组合
SQLite queries the maximum value and returns the whole row of data
JDBC calls the stored procedure with call and reports an error
自建DNS服务器,客户端打开网页慢,解决办法
Text classification still stays at Bert? The dual contrast learning framework is too strong
01. Project introduction of blog development project
[experience] install Visio on win11
类和对象(一)this指针详解
B站刘二大人-数据集及数据加载 Lecture 8
UCF (summer team competition II)
Migrate Infones to stm32
Safe mode on Windows
PDK工藝庫安裝-CSMC
【torch】|torch. nn. utils. clip_ grad_ norm_
[string] palindrome string of codeup
PDK process library installation -csmc
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
How can large websites choose better virtual machine service providers?