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
相关推荐
peachSoda722 分钟前
封装一个不同跳转方式的通用方法(跳转外部链接,跳转其他小程序,跳转半屏小程序)
前端·javascript·微信小程序·小程序
@PHARAOH34 分钟前
HOW - 浏览器兼容(含 Safari)
前端·safari
undefined在掘金390411 小时前
flutter 仿商场_首页
前端
少卿1 小时前
react-native图标替换
前端·react native
熊猫钓鱼>_>1 小时前
TypeScript前端架构与开发技巧深度解析:从工程化到性能优化的完整实践
前端·javascript·typescript
JYeontu2 小时前
肉眼难以分辨 UI 是否对齐,写个插件来辅助
前端·javascript
fox_2 小时前
别再踩坑!JavaScript的this关键字,一次性讲透其“变脸”真相
前端·javascript
盛夏绽放2 小时前
uni-app Vue 项目的规范目录结构全解
前端·vue.js·uni-app
少卿2 小时前
React Native Vector Icons 安装指南
前端·react native
国家不保护废物2 小时前
Vue组件通信全攻略:从父子传到事件总线,玩转组件数据流!
前端·vue.js