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

安装成功

相关推荐
Lucky_Turtle6 小时前
【Node】npm install报错npm error Cannot read properties of null (reading ‘matches‘)
前端·npm·node.js
水冗水孚11 小时前
20张图的保姆级教程,记录使用Verdaccio在Ubuntu服务器上搭建Npm私服
npm
无意feel15 小时前
MacOS 安装neofetch cmatrix lolcat
macos·数字雨·彩虹特效
KevinShi_BJ16 小时前
MacOS 上安装 Docker 和启动 LangBot
macos
ricky_fan18 小时前
(25年12月)claude code报错:might not be available in your country
macos·bash
james bid18 小时前
MacBook Pro 2015 上 XUbuntu 24.04 启用 eGPU (GeForce GTX 1080 Ti) 和核显黑屏问题解决
linux·ubuntu·macos·cuda·egpu
Irene199119 小时前
npm 完整生命周期脚本及特点
npm·生命周期
私人珍藏库19 小时前
[Mac] Mac风扇控制软件 iFan V1.1.1
macos
腾讯云qcloud075520 小时前
腾讯位置商业授权iOS 轨迹SDK
macos·ios·cocoa
新手村领路人20 小时前
MacOS Tahoe26.1自制定时休眠app
macos