赞
踩
因为众所周知的原因,我们从拉取从官方源拉取npm 依赖,经常容易出现超时,拉取失败的情况。这个时候我们就非常有必要切换使用国内源了,如淘宝源等
npm --registry https://registry.npm.taobao.org install XXX(模块名)
npm config get registry
npm config set registry https://registry.npm.taobao.org
npm config set registry https://registry.npmjs.org/
cnpm是一个命令,用它来代替npm
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install XXX(模块名)
nrm 是一个 npm 源管理器,允许你快速地在 npm源间切换
npm install -g nrm
nrm use taobao
nrm ls # 查看当前可用源命令
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。