npm常用指令,npm 下载有问题?

1.查看当前地址:
npm config get registry 
 
2.设置当前地址(设置为淘宝镜像)

注意:原来的 https://registry.npm.taobao.org 已替换为 https://registry.npmmirror.com ,

因为2024年1 月 22 日,淘宝原镜像域名(registry.npm.taobao.org)的 HTTPS 证书正式到期并更换为更为低调符合国家法律规定的镜像服务,这是一个完整 npmjs.org 镜像,你可以用此代替官方版本(只读),同步频率目前为 10分钟 一次以保证尽量与官方服务同步


npm config set registry   https://registry.npmmirror.com 


3.设置当前地址(设置为默认官方npm地址)
npm config set registry https://registry.npmjs.org/
 
4.每次执行命令前加入–registry指定仓库路径
npm --registry https://registry.npm.taobao.org install


5.查看所有全局安装的依赖包:

npm list -g

6.更新模块

npm update express(要更新的依赖名)

7.使用cnpm

你可以使用淘宝定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm:

npm install -g cnpm --registry=https://registry.npmmirror.com
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值