mac 安装cnpm 淘宝镜像记录

安装

shell 复制代码
npm install cnpm -g --registry=https://registry.npm.taobao.org

会报错 没有权限,这时需要加上sudo

shell 复制代码
sudo npm install cnpm -g --registry=https://registry.npm.taobao.org

这时候如果有些人会报错,证书过期不能访问之类的

需要加上

shell 复制代码
npm config set strict-ssl false

取消https认证

最后可能会出现的问题就是 npm-v的时候提示报错

这是因为cnpm版本跟当前npm版本不一致导致

这时候我们需要卸载cnpm

shell 复制代码
npm uninstall cnpm

然后查看当前npm版本

shell 复制代码
npm -v

发现当前版本是 6.14.8

这时我们重新安装cnpm 并且指定版本

shell 复制代码
sudo npm install -g cnpm@6.0.0 --registry=https://registry.npm.taobao.org

此时我们

shell 复制代码
cnpm -v

安装成功

相关推荐
yuyousheng8 小时前
mac 电脑复制粘贴剪切逻辑
macos
旭日跑马踏云飞9 小时前
【macOS】相关
macos
lichao8904271 天前
MacOS 上部署 OpenClaw 的全界面操作方案
macos·docker·容器
美酒没故事°1 天前
mac电脑安装OpenClaw步骤
人工智能·macos
受打击无法动弹2 天前
Window 10部署openclaw报错node.exe : npm error code 128
npm·node.js·openclaw
开发者导航3 天前
【开发者导航】多功能生成模型开发工具:Diffusers 详细介绍
人工智能·python·学习·macos·信息可视化
未名编程4 天前
Linux / macOS / Windows 一条命令安装 Node.js + npm(极限一行版大全)
linux·macos·node.js
was1724 天前
使用 Mole 进行 macOS 深度清理与系统优化
macos·系统清理·cli 工具