关于npm install的一些问题
npm install镜像问题
npm install 过程中下载binary太慢,在在项目内添加一个 .npmrc 文件:
// 设置npm 淘宝源
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
registry=https://registry.npm.taobao.org
npm install镜像问题2
如果你的电脑没有FQ功能,建议把npm的镜像源全都替换为淘宝的镜像,要不然还是太慢了 :
// 得到原本的镜像地址
npm get registry
得到下面的地址
// 设成淘宝的镜像源
npm config set registry http://registry.npm.taobao.org/
如果不想用淘宝镜像,也可以设置回来
// 换回原来的
npm config set registry https://registry.npmjs.org/