NPM淘宝加速设置

作者: 饥人谷_風逝 | 来源:发表于2017-03-31 19:54 被阅读376次

再抄之前,打开 Git Bash,我们要设置一个 npm,让 npm 下载得更快一些

1、运行 npm config set loglevel http,让你知道 npm 发的每一个请求
2、运行 npm config set progress false,关闭那个无聊的进度条
3、运行 npm config set registry https://registry.npm.taobao.org/ , 从淘宝的服务器下载各种包。不过这会让你在运行 npm adduser 的时候出问题,想要恢复成原样,只需要运行 npm config delete registry 即可。
4、运行 touch ~/.bashrc; echo 'export PHANTOMJS_CDNURL="http://npm.taobao.org/mirrors/phantomjs"' >> ~/.bashrc 让 npm 从淘宝下载 phantomjs
5、运行 touch ~/.bashrc; echo 'export SASS_BINARY_SITE="https://npm.taobao.org/mirrors/node-sass"' >> ~/.bashrc 让 npm 从淘宝下载 SASS
6 运行 source ~/.bashrc

相关文章

网友评论

    本文标题:NPM淘宝加速设置

    本文链接:https://www.haomeiwen.com/subject/jlnvottx.html