npm切换镜像源



概述

由于网络问题,使用npm官方源安装模块可能会导致速度慢或连接失败的问题。切换国内的镜像源可以达到更快的访问速度和连接稳定性


一、镜像源

镜像网址
官方镜像https://registry.npmjs.org
淘宝镜像http://registry.npmmirror.com
阿里云镜像https://npm.aliyun.com
腾讯云镜像https://mirrors.cloud.tencent.com/npm
华为云镜像https://mirrors.huaweicloud.com/repository/npm
网易镜像https://mirrors.163.com/npm
中科大镜像http://mirrors.ustc.edu.cn
清华大学镜像https://mirrors.tuna.tsinghua.edu.cn

二、更换镜像

正常安装

npm install express

1.临时切换

临时切换为淘宝源

npm --registry http://registry.npmmirror.com install express

2.永久切换

永久切换为淘宝源

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

验证是否切换成功

npm config get registry

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值