npm无法安装node-sass的解决方法

使用npm install 命令安装node-sass时,经常出现安装失败的情况。原因在于npm服务器在美国,还有就是某强大的防火墙作用。导致模块无法下载。

1 npm install node-sass                                                      
1 Cannot download https://github.com/sass/node-sass/releases/download/v3.4.2/win32-x64-46_binding.node
2 
3 Hint: If github.com is not accessible in your location
4 try setting a proxy via HTTP_PROXY, e.g. 
5 export HTTP_PROXY=http://example.com:1234
6 or configure npm proxy via
7 npm config set proxy http://example.com:8080'

解决方法:
1、使用淘宝镜像完成安装。

1 npm install -g cnpm --registry=https://registry.npm.taobao.org
2 cnpm install node-sass

2、下载FQ软件直接完成下载安装

原文地址:https://www.cnblogs.com/whb17bcdq/p/6439417.html