Try reinstalling `node-sass` on node 0.12?

2019-01-09 22:34发布

I would like to use google web starter kit. I installed node.js v0.12.0, node-sass & gulp.

And then ran:

$ sudo npm install

When I typed gulp serve then got this error:

Using gulpfile ~/web-starter-kit/gulpfile.js Starting 'styles'... 'styles' errored after 93 ms 
Error: `libsass` bindings not found. Try reinstalling `node-sass`? at getBinding

I reinstalled node and gulp but this doesn't help.

What should I do next?

17条回答
欢心
2楼-- · 2019-01-09 23:07

If you use Gulp then try:

npm install gulp-sass

I had the same problem and the gulp-sass package was the problem.

查看更多
男人必须洒脱
3楼-- · 2019-01-09 23:07

For me, this issue was caused in my build system (Travis CI) by doing something kind of dumb in my .travis.yml file. In effect, I was calling npm install before nvm use 0.12, and this was causing node-sass to be built for 0.10 instead of 0.12. My solution was simply moving nvm use out of the .travis.yml file’s before_script section to before the npm install command, which was in the before_install section.

In your case, it is likely that whatever process you are starting with gulp is using a different version of node (than what you would expect).

查看更多
forever°为你锁心
4楼-- · 2019-01-09 23:09

npm rebuild node-sass was giving me errors (Ubuntu) and npm install gulp-sass didn't make the error go away.

Saw a solution on GitHub which worked for me:

npm uninstall --save-dev gulp-sass

npm install --save-dev gulp-sass

查看更多
\"骚年 ilove
5楼-- · 2019-01-09 23:09

You need to use the right version. Try:

nvm use 0.12
查看更多
闹够了就滚
6楼-- · 2019-01-09 23:14

I found this useful command:

npm rebuild node-sass

From the rebuild documentation:

This is useful when you install a new version of node (or switch node versions), and must recompile all your C++ addons with the new node.js binary.

http://laravel.io/forum/10-29-2014-laravel-elixir-sass-error

查看更多
倾城 Initia
7楼-- · 2019-01-09 23:14

I ran into this error using node 0.12.0 and it was fixed by deleting the existing /node_modules directory and running npm update.

查看更多
登录 后发表回答