当前位置:网站首页>[cnpm] tutorial
[cnpm] tutorial
2022-06-24 07:19:00 【A meteor unwilling to fall】
npm Because the source server is located abroad , download node Packet speed is slow ,cnpm Use domestic image , Download speed is better than npm
One 、 Installation test
- The publication number can be checked after installation , Indicates successful installation
# Installation instructions
npm i cnpm -g
# Detection command
cnpm -v
cnpmUse : holdnpmOf is replaced bycnpmJust go- such as :
npm iamount tocnpm i
Two 、 Difference between them
1. Domestic use npm The problem is
- install npm after , Every time we install a package , Our computers must be compatible with npm The server has a conversation , Go to npm Warehouse acquisition package .
- npm The default warehouse address is :
http://registry.npmjs.org
# View the current npm Warehouse address command
* npm config get registry
http://registry.npmjs.org
- because npm The remote server is abroad , So sometimes it is inevitable that the access is too slow , Even inaccessible .
- Taobao has built a domestic npm The server , It is now every 10 Minutes will go abroad npm Everything in the warehouse “ Carry ” Back to the domestic server , In this way, we can directly access the domestic server of Taobao ,
- Its address is :https://registry.npm.taobao.org
Solution 1 :
- Direct installation cnpm Install the software provided by Taobao cnpm, And change the server address to Taobao's domestic address ,
- command :
npm install -g cnpm --registry=https://registry.npm.taobao.org, - In the future, it will be installed directly cnpm replace npm,
- For example, the original npm The order is :
npm install uniq --save,cnpm The order is :cnpm install uniq --save
Solution 2 :
- Replace npm The warehouse address is Taobao image address ( recommend )
- command :
npm config set registry https://registry.npm.taobao.org, - See if the change was successful :
npm config get registry, - When installing later , Still use npm command , But it was actually downloaded from Taobao's domestic server
边栏推荐
猜你喜欢
随机推荐
Counter attack of flour dregs: MySQL 66 questions, 20000 words + 50 pictures
Decryption of the original divine square stone mechanism
内网学习笔记(4)
華為雲數據庫進階學習
NVIDIA control panel does not open what is NVIDIA control panel
PCL 点云按比率随机采样
PCL 计算多边形的面积
Research on redis High Availability Mechanism
Outils de débogage JVM - Arthas
In JS, the regular expression verifies the hour and minute, and converts the input string to the corresponding hour and minute
Spark累加器和广播变量
[security] how to [host security - hybrid cloud version] support secure access to non Tencent virtual machines
【Cnpm】使用教程
. Net7 miniapi (special part):preview5 optimizes JWT verification (Part 1)
【pointNet】基于pointNet的三维点云目标分类识别matlab仿真
An example of MySQL accidental deletion recovery - using Myflash
OMX的初始化流程
0 foundation a literature club low code development member management applet (5)
两个链表的第一个公共节点_链表中环的入口(剑指offer)
Win11笔记本省电模式怎么开启?Win11电脑节电模式打开方法









