New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装 node-sass 的正确姿势 #28

Open
lmk123 opened this Issue Nov 19, 2015 · 56 comments

Comments

@lmk123
Owner

lmk123 commented Nov 19, 2015

安装 node-sass 的时候总是会各种不成功,今天我琢磨了一会儿总算知道要怎么解决了。

首先要知道的是,安装 node-sass 时在 node scripts/install 阶段会从 github.com 上下载一个 .node 文件,大部分安装不成功的原因都源自这里,因为 GitHub Releases 里的文件都托管在 s3.amazonaws.com 上面,而这个网址在国内总是网络不稳定,所以我们需要通过第三方服务器下载这个文件。(顺带一提,你可以看看这个好玩的 commit

方法一:使用淘宝镜像

macOS 系统直接运行下面的命令即可:

SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass

我们一般更希望能跨平台、并且直接使用 npm install 安装所有依赖,所以我的做法是在项目内添加一个 .npmrc 文件:

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 安装 node-sasselectronphantomjs 时都能自动从淘宝源上下载,但是在使用 npm publish 的时候要把 registry 这一行给注释掉,否则就会发布到淘宝源上去了。

方法二:使用梯子

假设你的梯子在你本地机器上开启了一个第三方服务器 127.0.0.1:1080,那么只需按照下面的方法配置一下就能正常安装 node-sass 了(如果你开启的是 PAC 模式而不是全局模式,那还需要将 s3.amazonaws.com 加入 PAC 列表):

npm config set proxy http://127.0.0.1:1080
npm i node-sass

# 下载完成后删除 http 代理
npm config delete proxy

嗯,这样下来就能正常安装了。

@lmk123 lmk123 added the Sass label Jan 20, 2016

@lzxb

This comment has been minimized.

Show comment
Hide comment
@lzxb

lzxb Jul 26, 2016

卧槽,搞了一个下午,还是楼主的第一条管用

lzxb commented Jul 26, 2016

卧槽,搞了一个下午,还是楼主的第一条管用

@lmk123

This comment has been minimized.

Show comment
Hide comment
@lmk123

lmk123 Jul 26, 2016

Owner

哈哈,我当初也是搞了一下午才弄明白

Owner

lmk123 commented Jul 26, 2016

哈哈,我当初也是搞了一下午才弄明白

@lzxb

This comment has been minimized.

Show comment
Hide comment
@lzxb

lzxb commented Jul 26, 2016

@lmk123 669

@wSLecHayfIeNdock

This comment has been minimized.

Show comment
Hide comment
@wSLecHayfIeNdock

wSLecHayfIeNdock Aug 16, 2016

卧槽,我也是搞了一下午

wSLecHayfIeNdock commented Aug 16, 2016

卧槽,我也是搞了一下午

@wanming

This comment has been minimized.

Show comment
Hide comment
@wanming

wanming commented Aug 20, 2016

alec-baldwin-approval-Cgo9XkgzRcTPW

@megone

This comment has been minimized.

Show comment
Hide comment
@megone

megone Aug 29, 2016

楼主威武

megone commented Aug 29, 2016

楼主威武

@dear-lizhihua

This comment has been minimized.

Show comment
Hide comment
@dear-lizhihua

dear-lizhihua Oct 4, 2016

方法3 cnpm安装,淘宝做了node-sass的镜像
https://cnodejs.org/topic/5637549fd426a1404cbd0614

有些node包依赖于phantom,安装也会失败,同样解决办法也是cnpm安装

dear-lizhihua commented Oct 4, 2016

方法3 cnpm安装,淘宝做了node-sass的镜像
https://cnodejs.org/topic/5637549fd426a1404cbd0614

有些node包依赖于phantom,安装也会失败,同样解决办法也是cnpm安装

@lmk123

This comment has been minimized.

Show comment
Hide comment
@lmk123

lmk123 Oct 8, 2016

Owner

@dear-lizhihua 我的做法是在项目内添加一个 .npmrc 文件:

phantomjs_cdnurl=http://cnpmjs.org/downloads
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org

这样使用 npm install 安装 node-sass 和 phantomjs 时都能自动从淘宝源上下载,但是在使用npm publish 的时候要把 registry 这一行给注释掉,否则就会发布到淘宝源上去了。

Owner

lmk123 commented Oct 8, 2016

@dear-lizhihua 我的做法是在项目内添加一个 .npmrc 文件:

phantomjs_cdnurl=http://cnpmjs.org/downloads
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org

这样使用 npm install 安装 node-sass 和 phantomjs 时都能自动从淘宝源上下载,但是在使用npm publish 的时候要把 registry 这一行给注释掉,否则就会发布到淘宝源上去了。

sdvcrx added a commit to sdvcrx/dotfiles that referenced this issue Oct 15, 2016

@TracerLee TracerLee referenced this issue Nov 1, 2016

Open

SASS Tips #11

@yyzych

This comment has been minimized.

Show comment
Hide comment
@yyzych

yyzych Feb 5, 2017

楼主大发!

yyzych commented Feb 5, 2017

楼主大发!

@xiaofuyesnew

This comment has been minimized.

Show comment
Hide comment
@xiaofuyesnew

xiaofuyesnew Feb 7, 2017

对windows下的同学如果第一种办法无效的话可以拆分成两个命令

set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
npm install node-sass

然后每次安装之前都要set一下。秒装。

xiaofuyesnew commented Feb 7, 2017

对windows下的同学如果第一种办法无效的话可以拆分成两个命令

set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
npm install node-sass

然后每次安装之前都要set一下。秒装。

@paysage

This comment has been minimized.

Show comment
Hide comment
@paysage

paysage Feb 8, 2017

请问对应的依赖也会一起安装吗? 还是还得单独安装?

paysage commented Feb 8, 2017

请问对应的依赖也会一起安装吗? 还是还得单独安装?

@xiaofuyesnew

This comment has been minimized.

Show comment
Hide comment
@xiaofuyesnew

xiaofuyesnew Feb 13, 2017

@paysage 不需要单独安装,如果依赖中有node-sass的话,直接在npm install前面加SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
也就是这样:

SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install

在遇到node-sass的二进制文件时,会自动从淘宝的镜像里面开始下载。

结论: node-sass不需要单独安装

xiaofuyesnew commented Feb 13, 2017

@paysage 不需要单独安装,如果依赖中有node-sass的话,直接在npm install前面加SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
也就是这样:

SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install

在遇到node-sass的二进制文件时,会自动从淘宝的镜像里面开始下载。

结论: node-sass不需要单独安装

@xhlwill

This comment has been minimized.

Show comment
Hide comment
@xhlwill

xhlwill Feb 13, 2017

windows下在 git bash 窗口里(前提是安装了git)也可以直接运行这条命令

SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass

因为安装git就同时为windows安装了一个gnu环境 - mingw

xhlwill commented Feb 13, 2017

windows下在 git bash 窗口里(前提是安装了git)也可以直接运行这条命令

SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass

因为安装git就同时为windows安装了一个gnu环境 - mingw

@xiaofuyesnew

This comment has been minimized.

Show comment
Hide comment
@xiaofuyesnew

xiaofuyesnew Feb 14, 2017

@xhlwill 对,但是个人觉得git bash在win环境下的运行效率有点低,毕竟是杂交的环境。
用Cmder的话更快一点,也兼容了大部分bash命令。

xiaofuyesnew commented Feb 14, 2017

@xhlwill 对,但是个人觉得git bash在win环境下的运行效率有点低,毕竟是杂交的环境。
用Cmder的话更快一点,也兼容了大部分bash命令。

@leiboo

This comment has been minimized.

Show comment
Hide comment
@leiboo

leiboo Feb 24, 2017

给大神跪了,搞了一上午,还是第一种方法管用。

leiboo commented Feb 24, 2017

给大神跪了,搞了一上午,还是第一种方法管用。

@xhlwill

This comment has been minimized.

Show comment
Hide comment
@xhlwill

xhlwill Feb 27, 2017

@xiaofuyesnew 用了Cmder 也感觉很慢 TT

xhlwill commented Feb 27, 2017

@xiaofuyesnew 用了Cmder 也感觉很慢 TT

@zicongxie

This comment has been minimized.

Show comment
Hide comment
@zicongxie

zicongxie Mar 8, 2017

well done!

zicongxie commented Mar 8, 2017

well done!

@hy-inger

This comment has been minimized.

Show comment
Hide comment
@hy-inger

hy-inger Mar 10, 2017

第一种方法管用。楼主威武。

hy-inger commented Mar 10, 2017

第一种方法管用。楼主威武。

@Amoslb Amoslb referenced this issue Mar 19, 2017

Closed

楼主大神 #52

@hapiman hapiman referenced this issue Mar 27, 2017

Open

npm #7

@hardmen

This comment has been minimized.

Show comment
Hide comment
@hardmen

hardmen Apr 5, 2017

第一种方法有用

hardmen commented Apr 5, 2017

第一种方法有用

@nellochen

This comment has been minimized.

Show comment
Hide comment
@nellochen

nellochen Apr 19, 2017

卧槽,前来报到,被坑了。。。一直提示.net framework的问题,windows 10系统标识蛋疼,第一种方法可行!

nellochen commented Apr 19, 2017

卧槽,前来报到,被坑了。。。一直提示.net framework的问题,windows 10系统标识蛋疼,第一种方法可行!

@yifeikong

This comment has been minimized.

Show comment
Hide comment
@yifeikong

yifeikong Apr 30, 2017

谢谢楼主,每当遇到这种问题,就想骂一句「他喵的方滨兴」

yifeikong commented Apr 30, 2017

谢谢楼主,每当遇到这种问题,就想骂一句「他喵的方滨兴」

@onlywhite

This comment has been minimized.

Show comment
Hide comment
@onlywhite

onlywhite May 8, 2017

感谢楼主

好了,我是Windows系统,按楼上方法把第一个命令拆分成两个命令就好了。最后问一下,
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
操作完成之后,我需要把上面set的删除吗?

SASS_BINARY_SITE不是内部命令是怎么回事啊

onlywhite commented May 8, 2017

感谢楼主

好了,我是Windows系统,按楼上方法把第一个命令拆分成两个命令就好了。最后问一下,
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/
操作完成之后,我需要把上面set的删除吗?

SASS_BINARY_SITE不是内部命令是怎么回事啊

@xhlwill

This comment has been minimized.

Show comment
Hide comment
@xhlwill

xhlwill May 8, 2017

具体怎么出现报错

xhlwill commented May 8, 2017

具体怎么出现报错

@krystalcl

This comment has been minimized.

Show comment
Hide comment
@krystalcl

krystalcl commented May 16, 2017

楼主666

@krystalcl

This comment has been minimized.

Show comment
Hide comment
@krystalcl

krystalcl May 16, 2017

正好遇到这个问题,感谢感谢

krystalcl commented May 16, 2017

正好遇到这个问题,感谢感谢

@xhlwill

This comment has been minimized.

Show comment
Hide comment
@xhlwill

xhlwill May 17, 2017

@onlywhite 不用的,set设置的环境变量只在当前console生效,只是临时的,要永久用setx

xhlwill commented May 17, 2017

@onlywhite 不用的,set设置的环境变量只在当前console生效,只是临时的,要永久用setx

@yin-fan

This comment has been minimized.

Show comment
Hide comment
@yin-fan

yin-fan May 22, 2017

感谢楼主,问题解决了

yin-fan commented May 22, 2017

感谢楼主,问题解决了

@andyiac

This comment has been minimized.

Show comment
Hide comment
@andyiac

andyiac Jun 13, 2017

使用梯子还有一种一劳永逸的姿势:

安装配置下 proxychains4

brew install proxychains-ng

在配置文件

/usr/local/etc/proxychains.conf

下添加一行

socks5  127.0.0.1 1080

然后

proxychains4 npm install 

以后下载被河蟹的内容加上 proxychains4 就行了

andyiac commented Jun 13, 2017

使用梯子还有一种一劳永逸的姿势:

安装配置下 proxychains4

brew install proxychains-ng

在配置文件

/usr/local/etc/proxychains.conf

下添加一行

socks5  127.0.0.1 1080

然后

proxychains4 npm install 

以后下载被河蟹的内容加上 proxychains4 就行了

@revanli

This comment has been minimized.

Show comment
Hide comment
@revanli

revanli Jun 22, 2017

各种google, 后来用中文搜一下,找到这里,第一条管用,蛋疼的问题

revanli commented Jun 22, 2017

各种google, 后来用中文搜一下,找到这里,第一条管用,蛋疼的问题

@feizhen

This comment has been minimized.

Show comment
Hide comment
@feizhen

feizhen Jul 5, 2017

其实可以安装cnpm,然后使用cnpm来安装就好了

feizhen commented Jul 5, 2017

其实可以安装cnpm,然后使用cnpm来安装就好了

@fanerge

This comment has been minimized.

Show comment
Hide comment
@fanerge

fanerge Jul 5, 2017

我是用方法三弄好了,社区的力量强大

fanerge commented Jul 5, 2017

我是用方法三弄好了,社区的力量强大

@yl1003

This comment has been minimized.

Show comment
Hide comment
@yl1003

yl1003 Jul 12, 2017

方法1直接就可以了

yl1003 commented Jul 12, 2017

方法1直接就可以了

@delsedin

This comment has been minimized.

Show comment
Hide comment
@delsedin

delsedin Jul 14, 2017

感谢感谢,用方法1终于搞定。

delsedin commented Jul 14, 2017

感谢感谢,用方法1终于搞定。

@zhaoboxiang

This comment has been minimized.

Show comment
Hide comment
@zhaoboxiang

zhaoboxiang Jul 18, 2017

感谢感谢感谢!折腾半天了!楼主威武!方法一弄好的

zhaoboxiang commented Jul 18, 2017

感谢感谢感谢!折腾半天了!楼主威武!方法一弄好的

@xiaozhouwu

This comment has been minimized.

Show comment
Hide comment
@xiaozhouwu

xiaozhouwu commented Jul 18, 2017

good

@PiscesKnight

This comment has been minimized.

Show comment
Hide comment
@PiscesKnight

PiscesKnight Jul 28, 2017

用的第二个方法,超感谢,折腾老半天

PiscesKnight commented Jul 28, 2017

用的第二个方法,超感谢,折腾老半天

@Vivomo

This comment has been minimized.

Show comment
Hide comment
@Vivomo

Vivomo Aug 7, 2017

用的第二个方法, 感激涕零

Vivomo commented Aug 7, 2017

用的第二个方法, 感激涕零

@LiuSuY

This comment has been minimized.

Show comment
Hide comment
@LiuSuY

LiuSuY Aug 22, 2017

感谢楼主,帮助我很容易解决了这个问题

LiuSuY commented Aug 22, 2017

感谢楼主,帮助我很容易解决了这个问题

@soarpatriot

This comment has been minimized.

Show comment
Hide comment
@soarpatriot

soarpatriot commented Nov 14, 2017

🙏 感谢

@LiuSuY

This comment has been minimized.

Show comment
Hide comment
@LiuSuY

LiuSuY Nov 14, 2017

现在可以使用yarn安装也可以解决这个问题

LiuSuY commented Nov 14, 2017

现在可以使用yarn安装也可以解决这个问题

@nonlau

This comment has been minimized.

Show comment
Hide comment
@nonlau

nonlau Nov 29, 2017

windows下,拆分命令后,还是不行
$ npm install node-sass

node-sass@4.7.2 install E:\workSpace\nonlau\hexo\node_modules\node-sass
node scripts/install.js

'node' ▒▒▒▒▒ڲ▒▒▒▒ⲿ▒▒▒Ҳ▒▒▒ǿ▒▒▒▒еij▒▒▒
▒▒▒▒▒▒▒▒▒ļ▒▒▒
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fseven1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x6)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.7.2 install: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.7.2 install script.

nonlau commented Nov 29, 2017

windows下,拆分命令后,还是不行
$ npm install node-sass

node-sass@4.7.2 install E:\workSpace\nonlau\hexo\node_modules\node-sass
node scripts/install.js

'node' ▒▒▒▒▒ڲ▒▒▒▒ⲿ▒▒▒Ҳ▒▒▒ǿ▒▒▒▒еij▒▒▒
▒▒▒▒▒▒▒▒▒ļ▒▒▒
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fseven1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x6)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.7.2 install: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.7.2 install script.

@LiuSuY

This comment has been minimized.

Show comment
Hide comment
@LiuSuY

LiuSuY Nov 29, 2017

你可以试试yarn add node-sass

LiuSuY commented Nov 29, 2017

你可以试试yarn add node-sass

@Yapril

This comment has been minimized.

Show comment
Hide comment
@Yapril

Yapril Apr 11, 2018

用git终端 npm install node-sass 一次搞定~

Yapril commented Apr 11, 2018

用git终端 npm install node-sass 一次搞定~

@EchoQ0Q

This comment has been minimized.

Show comment
Hide comment
@EchoQ0Q

EchoQ0Q Apr 13, 2018

楼主请问下,如果我内网安装node-sass,并且把binding.node文件放在了C盘根目录下,应该如何设置才能找到这个文件呢?

EchoQ0Q commented Apr 13, 2018

楼主请问下,如果我内网安装node-sass,并且把binding.node文件放在了C盘根目录下,应该如何设置才能找到这个文件呢?

@LiuSuY

This comment has been minimized.

Show comment
Hide comment
@LiuSuY

LiuSuY Apr 13, 2018

1 . node -p "[process.platform, process.arch, process.versions.modules].join('-')"
2. set SASS_BINARY_PATH=D:/nodejs/.nodes/win32-x64-57_binding.node (win32-x64-57_binding.node文件百度下载)
3. npm install node-sass

LiuSuY commented Apr 13, 2018

1 . node -p "[process.platform, process.arch, process.versions.modules].join('-')"
2. set SASS_BINARY_PATH=D:/nodejs/.nodes/win32-x64-57_binding.node (win32-x64-57_binding.node文件百度下载)
3. npm install node-sass

@morenyang

This comment has been minimized.

Show comment
Hide comment
@morenyang

morenyang Apr 14, 2018

使用yarn的话可以把下面这一行代码加入到.yarnrc里面 mac实测秒载
sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

morenyang commented Apr 14, 2018

使用yarn的话可以把下面这一行代码加入到.yarnrc里面 mac实测秒载
sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

@vv314

This comment has been minimized.

Show comment
Hide comment
@vv314

vv314 Apr 17, 2018

npm config set sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

yarn 的 config 会继承 npm 的 config,所以只用设置 npm 的映射就行,
当然,如果不放心也可以:

yarn config set sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

上述命令其实就通过命令方式是改了 .npmrc.yarnrc,和手动修改是等价的。

vv314 commented Apr 17, 2018

npm config set sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

yarn 的 config 会继承 npm 的 config,所以只用设置 npm 的映射就行,
当然,如果不放心也可以:

yarn config set sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

上述命令其实就通过命令方式是改了 .npmrc.yarnrc,和手动修改是等价的。

@jerry9926

This comment has been minimized.

Show comment
Hide comment
@jerry9926

jerry9926 Apr 23, 2018

卧槽,搞了一个下午,还是楼主的第一条管用 +1

jerry9926 commented Apr 23, 2018

卧槽,搞了一个下午,还是楼主的第一条管用 +1

@JSoon

This comment has been minimized.

Show comment
Hide comment
@JSoon

JSoon commented May 14, 2018

mark

@taojason88

This comment has been minimized.

Show comment
Hide comment
@taojason88

taojason88 May 16, 2018

感觉楼主的第一方法,弄了几个小时终于好了

taojason88 commented May 16, 2018

感觉楼主的第一方法,弄了几个小时终于好了

@yexk

This comment has been minimized.

Show comment
Hide comment
@yexk

yexk May 22, 2018


gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '10.1.0' ]
gyp verb install input version string "10.1.0"
gyp verb install installing version: 10.1.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 10.1.0
gyp verb ensuring nodedir is created /www/project/node_modules/node-sass/.node-gyp/10.1.0
gyp WARN EACCES user "root" does not have permission to access the dev dir "/www/project/node_modules/node-sass/.node-gyp/10.1.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/www/project/node_modules/node-sass/.node-gyp"

大佬。centos 7.2 ,node v10.1.0 npm 5.6.0 淘宝源。。这个错误怎么解决??

yexk commented May 22, 2018


gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '10.1.0' ]
gyp verb install input version string "10.1.0"
gyp verb install installing version: 10.1.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 10.1.0
gyp verb ensuring nodedir is created /www/project/node_modules/node-sass/.node-gyp/10.1.0
gyp WARN EACCES user "root" does not have permission to access the dev dir "/www/project/node_modules/node-sass/.node-gyp/10.1.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/www/project/node_modules/node-sass/.node-gyp"

大佬。centos 7.2 ,node v10.1.0 npm 5.6.0 淘宝源。。这个错误怎么解决??

@hucheng91

This comment has been minimized.

Show comment
Hide comment
@hucheng91

hucheng91 May 29, 2018

发现其实在github下不到,是会去本地的 Users\user\AppData\Roaming\npm-cache\node-sass(比方,我电脑用户名叫 hc,一般在c:\Users\user\AppData\Roaming\npm-cache\node-sass)这个目录找,那解决办法就是,先去https://github.com/sass/node-sass/releases,将需要的*_binding.node下载下来,放到本地对应目录就好

hucheng91 commented May 29, 2018

发现其实在github下不到,是会去本地的 Users\user\AppData\Roaming\npm-cache\node-sass(比方,我电脑用户名叫 hc,一般在c:\Users\user\AppData\Roaming\npm-cache\node-sass)这个目录找,那解决办法就是,先去https://github.com/sass/node-sass/releases,将需要的*_binding.node下载下来,放到本地对应目录就好

@hucheng91

This comment has been minimized.

Show comment
Hide comment
@hucheng91

hucheng91 commented May 29, 2018

angular-cli-node-sass-bug-3

@hucheng91

This comment has been minimized.

Show comment
Hide comment
@hucheng91

hucheng91 May 29, 2018

自己下载下来,放到cache 目录下就可以了,lunix 系在 当前用户 .npm 目录下

hucheng91 commented May 29, 2018

自己下载下来,放到cache 目录下就可以了,lunix 系在 当前用户 .npm 目录下

@ShumRain

This comment has been minimized.

Show comment
Hide comment
@ShumRain

ShumRain Aug 1, 2018

非常感谢!

ShumRain commented Aug 1, 2018

非常感谢!

@tsingroo

This comment has been minimized.

Show comment
Hide comment
@tsingroo

tsingroo Aug 1, 2018

Ubuntu下使用如下命令设置NodeSass源
export SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/

tsingroo commented Aug 1, 2018

Ubuntu下使用如下命令设置NodeSass源
export SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment