在安装vue的过程中,每每用到npm的时候都会超时,必须使用淘宝镜像。
永久使用:
npm config set registry https://registry.npm.taobao.org
临时使用:
npm install node-sass --registry=http://registry.npm.taobao.org
还有个常用命令,可以解决些奇怪的问题
npm cache clean --force
最后发现问题还没有解决,有贴子说是npm版本的问题,尝试降到了5还是不行,最后降到4.6.1,执行npm install正常完成。
npm -g i npm@4
另外还有其他的源:
npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
taobao - http://registry.npm.taobao.org/
eu ----- http://registry.npmjs.eu/
au ----- http://registry.npmjs.org.au/
sl ----- http://npm.strongloop.com/
nj ----- https://registry.nodejitsu.com/
原文:https://blog.csdn.net/wangxp/article/details/81535786