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

安装成功

相关推荐
Ceelog9 小时前
MemoryBubble(内存泡泡) 戳泡泡清理 Mac 内存
macos·mac
毛小茛15 小时前
pnpm 已经安装成功,但 npm 的全局 bin 目录没有进 PATH
前端·npm·node.js
扑火的小飞蛾17 小时前
【macOS】n8n 安装配置笔记
笔记·macos
TO_ZRG19 小时前
iOS 符号表文件概要
macos·ios·cocoa
默默在路上19 小时前
M芯片使用VMware Fusion安装CentOS Stream 9教程
linux·macos·centos
ljh57464911919 小时前
npm run build:prod 打包后,文件中的console.log 失效
前端·npm·node.js
TheNextByte119 小时前
如何在Mac上收发Android信息 [2026 指南]
android·macos
耘田19 小时前
 macOS Launch Agent 定时任务实践指南
java·开发语言·macos
不爱吃糖的程序媛19 小时前
macOS 系统本地安装 openJiuwen 完整指南
macos
William.csj19 小时前
Mac——一款支持跨平台的与服务器之间的远程传输工具 FileZilla
macos·filezilla