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

安装成功

相关推荐
带娃的IT创业者7 小时前
解密OpenClaw系列07-OpenClaw数据流分析
macos·软件工程·agent·ai智能体·智能体开发·openclaw
天開神秀7 小时前
解决 n8n 在 Windows 上安装社区节点时 `spawn npm ENOENT/EINVAL` 错误
前端·windows·npm
春波petal9 小时前
MacOS 13.7.8版本-前端环境一键搭建指南
前端·macos
eppen1 天前
macOS 快捷键修改
macos
郁大锤1 天前
macOS 终端 SSH 到 Linux 后快捷键失效解决方法
linux·macos·ssh
阿捏利1 天前
详解Mach-O(十三)Mach-O __TEXT
macos·ios·c/c++·mach-o
Laughtin1 天前
macos的python安装选择以及homebrew python的安装方法
开发语言·python·macos
猫头虎1 天前
OpenClaw相关的开源AI项目汇总大全:本文涵盖近期所有OpenClaw相关的GitHub高星star热门项目
运维·人工智能·macos·docker·容器·开源·github
eppen1 天前
macos 分屏软件
macos
coderYYY2 天前
VSCode终端启动报错
前端·ide·vscode·npm·编辑器