1

Whenever I try to setup sass in ionic I get the following error

Error: `libsass` bindings not found. Try reinstalling `node-sass`?

I tried to rebuild sass as mentioned in many forums but get no results. I'm using node v4.2.1

  • You have to have the ruby gem `sass` installed. Make sure you got ruby with `ruby -v`, if you don't, you can install it with RVM `\curl -sSL https://get.rvm.io | bash -s stable --ruby`. Then run `gem install sass`. Take close note to the RVM installation, it will tell you what to do. – Sven Oct 15 '15 at 11:51
  • Found the solution here!!! http://stackoverflow.com/questions/32594885/error-running-gulp-sass-after-update-to-node-v4-0-0 – Xabier Maeztu Oct 16 '15 at 10:44

1 Answers1

0

I've just fixed problems with libsass or node-sass with this command:

$ sudo rm -rf node_modules/ && cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^2.0.4"/g' package.json && npm install && ionic lib update

Where X is the version of gulp-sass in your package.json

Explanation:

Remove the old files in node_modules. I'm not sure is necessary to use 'sudo' (in my case, yes).

$ sudo rm -rf node_modules/

Search and replace inside package.json updating gulp-sass version to ^2.0.4. It also creates a backup (package.json.bak),

$ cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^2.0.4"/g' package.json

Reinstall dependencies

$ npm install

Update the ionic lib in the project

ionic lib update

If you have any further problems be sure I try can help you...

Bye

Community
  • 1
  • 1
gabfiocchi
  • 190
  • 11