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

安装成功

相关推荐
心灵宝贝2 小时前
Mac 安装 JDK 8u281(JDK-8u281-1.dmg)详细步骤(附安装包)
java·macos·intellij-idea
侯小啾10 小时前
理解计算机网络中的MAC地址
网络·计算机网络·macos·mac
坚果派·白晓明14 小时前
开源鸿蒙终端工具Termony构建HNP包指导手册Mac版
macos·开源·harmonyos
CXH72818 小时前
k8s-host-mac
macos·容器·kubernetes
德生coding19 小时前
linux系统多网卡共用一个MAC地址的使用问题
macos
m0_495562781 天前
iOS的蓝牙
macos·ios·cocoa
blackorbird1 天前
iOS 18-26 越狱关键突破:实现沙箱逃逸与权限提升
macos·ios·objective-c·cocoa
百***58841 天前
MacOS升级ruby版本
开发语言·macos·ruby
2501_915921432 天前
Windows 系统下的 IPA 加密工具实战指南,如何在非 macOS 环境完成 IPA 混淆、加固与工程化处理
android·windows·macos·ios·小程序·uni-app·iphone
mixboot2 天前
配置 Node.js npm镜像源 安装 Claude Code
npm·node.js·nvm·claude code