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

安装成功

相关推荐
白白李媛媛4 小时前
上传Vue3+vite+Ts组件到npm官方库保姆级教程
前端·arcgis·npm
whale fall15 小时前
npm install安装的node_modules是什么
前端·npm·node.js
做梦都在学习前端19 小时前
发布一个monaco-editor 汉化包
前端·npm·vite
瓜子三百克1 天前
CALayer的异步处理
macos·ios·cocoa
Fine姐1 天前
传感器WSNs TheDataLinkLayer——B-MAC
macos
九丝城主1 天前
2025使用VM虚拟机安装配置Macos苹果系统下Flutter开发环境保姆级教程--中篇
服务器·flutter·macos·vmware
呆萌的代Ma1 天前
解决Mac上的老版本docker desktop 无法启动/启动后一直转圈/无法登陆账号的问题
macos·docker·eureka
fengyun28911 天前
Omi录屏专家 Screen Recorder by Omi 屏幕录制Mac
macos·mac·录屏·屏幕录制
不学会Ⅳ1 天前
Mac M芯片搭建jdk源码环境(jdk24)
java·开发语言·macos
九丝城主2 天前
2025使用VM虚拟机安装配置Macos苹果系统下Flutter开发环境保姆级教程--上篇
服务器·flutter·macos·vmware