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.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
相关推荐
JavaGuide27 分钟前
刚刚,阿里版 Codex 上线了匿名模型 HungerG,无限 Token!
前端·后端
zhanlang021736 分钟前
HTML 零基础入门到企业实战全套教程【第九章 9.3】移动端 HTML 基础适配入门
前端·html
用户693717500138443 分钟前
AI 帮我写了大半年的代码,我却越来越不会写代码了
前端·后端·github
skywalk81631 小时前
把「假成功」赶出工具层:lightharness 两天升级复盘(4×5 模式矩阵 + 工具层 5 个缺陷)
开发语言·前端·人工智能·lightharness
彭亚川Allen1 小时前
从零手搓 RAG:用 Elasticsearch 存储与检索向量
前端·后端·面试
jerrywus1 小时前
15 个可以直接安装的 AI Agent Skills:按场景挑
前端·agent·claude
涛涛ing2 小时前
用了三年微前端,我们终于把它拆成了单体应用
前端
去伪存真2 小时前
《最终版》《打死不改版》全传一遍?RAG 系统文件去重实战
前端
anyup2 小时前
【全端支持】 uni-app x 专用请求库:axios 写法,多实例、拦截器、可中断、上传下载
前端·uni-app·unix
费曼学习法3 小时前
6 个 MCP Server 传输层重写实录:超时率 12% → 0.3%
前端·后端