npm更换为镜像

背景:npm在安装的过程中需用从国外的网站获取代码,速度非常慢,因此更换为淘宝镜像,提升速度。

1.永久起作用:

1 npm config set registry https://registry.taobao.org

2.验证是否设置成功:

1 npm config get registry

3.在使用npm install进行安装时报错,error code EINTEGRITY:

使用如下命令清缓存

1 npm cache verify

猜你喜欢

转载自www.cnblogs.com/zhuzhaoli/p/10246887.html