npm install npm@4.6.1 -g
npm 下载较慢,普遍使用cnpm淘宝镜像下载,安装淘宝镜像需要使用指定npm版本。
npm默认的源地址是 https://registry.npmjs.org
修改 registry,让其指向 淘宝镜像 的地址,如下
$ npm config set registry https://registry.npm.taobao.org
查询npm配置的地址。
$ npm config get registry
# 或者使用
$ npm info express

在npm下载速度较慢的情况下,可以改用淘宝镜像以加速。通过设置npm配置,将registry改为https://registry.npm.taobao.org,然后查询确认配置是否成功。这使得开发者能更高效地安装和管理依赖包。
1万+

被折叠的 条评论
为什么被折叠?



