npm设置源(原淘宝源域名已过期)

今天打包机器报错,

Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.

找不到antd mobile的包,查看源发现淘宝域名npm.taobao.org 和 registry.npm.taobao.org 域名证书已过期,导致npm找不到包

使用新域名:

registry.npmmirror.com

设置方式:


1.通过cnpm使用淘宝镜像:

npm install -g cnpm --registry=https://registry.npmmirror.com

2.将npm设置为淘宝镜像:

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

3.将yarn设置为淘宝镜像

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

4解决node-sass无法下载下来的问题

yarn config set sass_binary_site https://cdn.npmmirror.com/dist/node-sass

5. 查看cnpm镜像设置:

cnpm config get registry

6.查看npm镜像设置:

npm config get registry

7.查看yarn镜像设置:

yarn config get registry

你可能感兴趣的:(前端,npm,前端,node.js)