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
相关推荐
cos14 分钟前
Fork 主题如何更新?基于 Ink 构建主题更新 CLI 工具
前端·javascript·git
小满zs16 分钟前
Next.js第二十一章(环境变量)
前端·next.js
C***115020 分钟前
Spring aop 五种通知类型
java·前端·spring
朝阳391 小时前
前端项目的【package-lock.json】详解
前端
摸鱼的春哥2 小时前
AI编排实战:用 n8n + DeepSeek + Groq 打造全自动视频洗稿流水线
前端·javascript·后端
nece0012 小时前
vue3杂记
前端·vue
Carry3453 小时前
不清楚的 .gitignore
前端·git
张鑫旭3 小时前
AI时代2025年下半年学的这些Web前端特性有没有用?
前端·ai编程
pinkQQx3 小时前
H5唤醒APP技术方案入门级介绍
前端