前言
因为淘宝镜像源调整了,所以更新下本文;
内容
配置
代码语言:javascript复制# 临时使用
npm --registry https://registry.npmmirror.com install express1
# 永久使用
npm config set registry https://registry.npmmirror.com
验证
代码语言:javascript复制$ npm config get registry
https://registry.npmmirror.com //成功返回
$ npm info express
express@4.16.4 | MIT | deps: 30 | versions: 261 //成功返回
Fast, unopinionated, minimalist web framework
http://expressjs.com/
dist
.tarball https://registry.npmmirror.com/express/download/express-4.16.4.tgz
.shasum: fddef61926109e24c515ea97fd2f1bdbf62df12e
....
配置cnpm
代码语言:javascript复制npm install -g cnpm --registry=https://registry.npmmirror.com
找到安装位置,配置环境变量并验证