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.orgregistry.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
相关推荐
Vicky&James1 分钟前
WPF到Web的无缝过渡:英雄联盟客户端项目OpenSilver迁移实战
前端·wpf
m0_748233644 分钟前
RabbitMQ 进阶
android·前端·后端
不想有bug的小菜鸟13 分钟前
vue3使用iframe全屏展示pdf效果
前端·pdf
m0_7482386314 分钟前
Spring Boot项目接收前端参数的11种方式
前端·spring boot·后端
u01005596014 分钟前
前端代理,解决跨域问题讲解
前端
quitv19 分钟前
react脚手架配置别名
前端·javascript·react.js
嘵奇20 分钟前
Node.js二:第一个Node.js应用
node.js
m0_5287238128 分钟前
前端如何进行性能优化
前端·性能优化
化作繁星30 分钟前
在 Vue 3 中,如何缓存和复用动态组件
前端·vue.js·缓存
一粒沙-1 小时前
iOS 将GIF图分享至微信
前端·ios