1.临时使用
npm --registry https://registry.npm.taobao.org install express
2.永久使用
npm config set registry https://registry.npm.taobao.org # https://registry.npm.taobao.org是淘宝镜像
3.添加cnpm使用
3.1 安装
npm install -g cnpm --registry=https://registry.npm.taobao.org # https://registry.npm.taobao.org是淘宝镜像
3.2 使用
$ cnpm install [name]
4.恢复使用
npm config set registry https://registry.npmjs.org #https://registry.npmjs.org是官网镜像
网友评论