使用如下解决办法,终于成功了,具体如下:
在项目内添加一个 .npmrc 文件:
phantomjs_cdnurl=http://cnpmjs.org/downloadssass_binary_site=https://npm.taobao.org/mirrors/node-sass/registry=https://registry.npm.taobao.org
然后使用 npm install 安装 node-sass 和 phantomjs 时都能自动从淘宝源上下载,但是在使用npm
publish的时候要把 registry 这一行给注释掉,否则就会发布到淘宝源上去了。
原因:不使用淘宝镜像时,始终下载不下来需要的文件
