当前位置:网站首页>Win10 uses NVM to install node, NPM, and cnpm
Win10 uses NVM to install node, NPM, and cnpm
2022-07-26 11:42:00 【Only now in my heart】
1.nvm-windows download
Download address https://github.com/coreybutler/nvm-windows/releases, download nvm-setup.zip
2. install nvm
First turn on the nvm-setup.zip decompression ( Whatever the address ); Then run as Administrator nvm-setup . choice nvm Installation directory is C:\Environment\Node\nvm,node Installation directory is C:\Environment\Node\nodejs, modify settings.txt The content is :
## The following contents are already configured during installation
root: C:\Environment\Node\nvm
path: C:\Environment\Node\nodejs
## The following contents need to be pasted
node_mirror: http://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
3. modify nvm environment variable
My computer -> attribute -> Advanced system setup -> environment variable , Add environment variables to user variables :
// The environment variables are already configured by the software at the time of installation
NVM_HOME:`C:\Environment\Node\nvm`
NVM_SYMLINK:`C:\Environment\Node\nvm`
PATH:%NVM_HOME%;%NVM_SYMLINK%
//(path It has been saved 【%NVM_HOME%;%NVM_SYMLINK%】 Add to the end )
4. adopt nvm install node
nvm -v // see nvm edition
nvm list available // View all available for download node edition
nvm install 8.12.0 // Download the specified version nvm install latest Install the latest version
nvm use 8.12.0 // Use the specified version
nvm ls // View the installed nodejs edition
node -v // see nodejs edition
5. Install Global npm
install node When ,npm In fact, it has been installed together . because nvm Can manage multiple versions of node, If you add one at a time node It is troublesome to install a lot of packages in every version , If there is a npm You can make various versions of node share , It wouldn't be so troublesome , This is why we need to configure a global npm Why . In three simple steps, you can configure a global npm.
1. For configuration npm Use when downloading packages -g Package path of global installation
npm config set prefix "C:\Environment\Node\npm
2. Install Global npm, Different node All use this npm, Want to update the overall npm First delete the global path ( Is the address of the last command , have access to npm config ls see , The default is .npmrl in ) Under the npm, Just execute this command again
npm install npm -g --registry=https://registry.npm.taobao.org
3. In the system environment variable Path Add C:\Environment\Node\npm, In this way, you can use the globally installed npm Package command . Be careful : After configuring the environment variables, be sure to click all the OK buttons to exit the environment variable setting , Then reopen a cmd The window will take effect .
4. verification npm Whether to install
npm -v
6. Some alternatives npm The way
1. Use taobao mirror cnmp replace npm
npm install -g cnpm --registry=https://registry.npm.taobao.org
2. verification cnpm Is it available
cnpm -v
cnpm config get registry
Reference blog
https://www.cnblogs.com/wyy1234/p/9727142.html
https://blog.csdn.net/JZevin/article/details/108350411?spm=1001.2014.3001.5506
边栏推荐
- Esp8266 Arduino programming example GPIO input and output
- X 2 Earn必须依靠旁氏启动?Gamefi的出路在哪?(上)
- Can SAIC mingjue get out of the haze if its products are unable to sell and decline
- Acwing727.菱形图案
- Pyechart离线部署
- 【万字长文】使用 LSM-Tree 思想基于.Net 6.0 C# 实现 KV 数据库(案例版)
- Didi was fined 8billion! The era of making money from user data is over
- DP的基本递归方程
- [vscode] how to connect to the server remotely
- win10使用nvm安装node、npm、cnpm
猜你喜欢

服务器内存故障预测居然可以这样做!

Hashtable

X 2 earn must rely on Ponzi startup? Where is the way out for gamefi? (top)

系统调用捕获和分—Ring3层LD_PRELOAD机制进行库函数劫持

ESP8266-Arduino编程实例-开发环境搭建(基于Arduino IDE)

Caused by: scala. MatchError: None (of class scala.None$)

Hal library IIC simulation in punctual atom STM32 `define SDA_ IN() {GPIOB->MODER&=~(3<<(9*2));GPIOB->MODER|=0<<9*2;}` // PB9 input mode

Three properties of concurrency

Wechat applet - Advanced chapter Lin UI component library source code analysis button component (I)

Data type of SQL Server database
随机推荐
【万字长文】使用 LSM-Tree 思想基于.Net 6.0 C# 实现 KV 数据库(案例版)
36. [difference between const function and function]
X 2 earn must rely on Ponzi startup? Where is the way out for gamefi? (top)
PostgreSQL in Linux and windows installation and introductory basic tutorial
Want the clouds in the picture to float? Video editing services can be achieved in three steps with one click
Basic concepts of JVM and memory management model
Rigorous proof of Behrman's expectation equation
702 horsepower breaks through 100 in only 4.5 seconds! The strongest pickup truck comes, safe and comfortable
Caused by: scala. MatchError: None (of class scala.None$)
Integrity constraints of SQL Server database
李宏毅《机器学习》丨2. Regression(回归)
Mlx90640 infrared thermal imager temperature sensor module development notes (6)
Static routing and dynamic routing
加载ORB词典
ESP8266-Arduino编程实例-开发环境搭建(基于PlatformIO)
『MongoDB』MongoDB高可用部署架构——复制集篇(Replica Set)
哈希表
Summary of common cmake commands
想让照片中的云飘起来?视频编辑服务一键动效3步就能实现
Real time streaming protocol --rtsp