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条回答
\"骚年 ilove
2楼-- · 2019-01-09 22:55

My issue was that I was on a machine with node version 0.12.2, but that had an old 1.x.x version of npm. Be sure to update your version of npm: sudo npm install -g npm Once that is done, remove any existing node-sass and reinstall it via npm.

查看更多
淡お忘
3楼-- · 2019-01-09 22:56

I removed all the /node_modules folder then ran npm install and it worked.

I have node v5.5.0, npm 3.3.12

查看更多
▲ chillily
4楼-- · 2019-01-09 23:00

I had the same issue as @Kos had, only for some reason I had to modify the gulp-sass package from the old package.json file I had. It then installed the dependencies currently and now it finally works!

查看更多
叛逆
5楼-- · 2019-01-09 23:02

If your node version is 4 and you are using gulp-sass, then try

npm uninstall --save-dev gulp-sass

npm install --save-dev gulp-sass@2
查看更多
一夜七次
6楼-- · 2019-01-09 23:02

i had the same problem today at work.

npm rebuild node-sass

done the job for me

查看更多
唯我独甜
7楼-- · 2019-01-09 23:06

Downgrading Node to 0.10.36 should do it per this thread on the node-sass github page: https://github.com/sass/node-sass/issues/490#issuecomment-70388754

If you have NVM you can just:

nvm install 0.10

If you don't, you can find NVM and instructions here: https://www.npmjs.com/package/nvm

查看更多
登录 后发表回答