本文主要是介绍npm设置源(原淘宝源域名已过期),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天打包机器报错,
Couldn't find package "antd-mobile@2.3.4" required by "neo-ui-mf-base@1.0.41" 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.com2.将npm设置为淘宝镜像:npm config set registry https://registry.npmmirror.com3.将yarn设置为淘宝镜像yarn config set registry https://registry.npmmirror.com4解决node-sass无法下载下来的问题yarn config set sass_binary_site https://cdn.npmmirror.com/dist/node-sass5. 查看cnpm镜像设置:cnpm config get registry6.查看npm镜像设置:npm config get registry7.查看yarn镜像设置:yarn config get registry
这篇关于npm设置源(原淘宝源域名已过期)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!