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

安装成功

相关推荐
一个写bug的程序员10 分钟前
Mac自启服务关闭方式
macos
梁下轻语的秋缘19 分钟前
初学者避坑指南:Mac 虚拟机搭建 Keil5 STM32 环境 + 解决 ST-Link USB Command Error 报错
windows·stm32·macos
Digitally28 分钟前
Mac 屏幕录制工具:12 款 Mac 屏幕录制工具
macos
阿赛工作室17 小时前
mac系统使用Hbuilderx调试安装app
macos
weixin_462446231 天前
Linux/Mac 一键自动配置 JAVA_HOME 环境变量(含 JDK 完整性校验)
java·linux·macos
Frank学习路上1 天前
【Qt】问题记录ld: framework ‘AGL‘ not found on MacOS 26
开发语言·qt·macos
SoraLuna1 天前
KuiklyUI for OpenHarmony 实战 02:Kuikly 工程创建与鸿蒙运行(Mac)
macos·华为·harmonyos
微信-since811921 天前
【mac】 mac使用
macos
REDcker2 天前
macOS「系统数据」暴涨到 几百GB?一篇文章教你安全清理(含排查顺序)
macos
sysinside2 天前
macOS Sequoia 15.7.2 (24G325) 正式版 ISO、IPSW、PKG 下载
macos·sequoia