npm无法安装node-sass

问题描述

使用npm install 命令安装node-sass时,出现安装失败的情况。

npm install node-sass
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/win32-x64-57_binding.node":

ESOCKETTIMEDOUT

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

解决方法

使用淘宝镜像完成安装

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

你可能感兴趣的:(sass,npm)