Node-sass install error

I’ve tried to install node-sass couple times and it did but its ionic is still complaining about it.

ionic $ /Users/Home/Documents/codes/talkipia_m/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:22
throw new Error(’libsass bindings not found. Try reinstalling node-sass?’);

Error: libsass bindings not found. Try reinstalling node-sass?
at getBinding (/Users/Home/Documents/codes/talkipia_m/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:22:11)
at Object. (/Users/Home/Documents/codes/talkipia_m/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:188:23)
at Module._compile (module.js:435:26)
at Object.Module._extensions…js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/Users/Home/Documents/codes/talkipia_m/node_modules/gulp-sass/index.js:3:17)
at Module._compile (module.js:435:26)
throw err;

Error: EACCES: permission denied, open '/Users/Home/.config/configstore/update-notifier-cordova.json’
You don’t have access to this file.

at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.create.all.get (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:34:26)
at Object.Configstore (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:27:44)
at new UpdateNotifier (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/index.js:34:17)
at module.exports (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/index.js:123:23)
at checkForUpdates (/usr/local/lib/node_modules/cordova/src/cli.js:64:20)
at cli (/usr/local/lib/node_modules/cordova/src/cli.js:114:5)
at Object.<anonymous> (/usr/local/lib/node_modules/cordova/bin/cordova:41:1)

my ionic info below

Cordova CLI: Not installed
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.0.1
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.2
ios-sim version: 5.0.3
OS: Mac OS X El Capitan
Node Version: v4.2.2
Xcode version: Xcode 7.1.1 Build version 7B1005

Can the problem be solved?

$ 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


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…

This is probably because you upgraded npm to version 3, they changed the layout of node_modules folder and some modules fail to install.

Not sure if it is related, but I have noticed that if you install “gulp-sass” before “node-sass” an error occurs.

The solution is to uninstall both modules and then install them in the correct order:

>$ npm uninstall node-sass
>$ npm uninstall gulp-sass
>$ npm install node-sass
>$ npm install gulp-sass

This is mostly caused by the “–save-dev” mark. When you use this mark, dependencies are written in alphabetical order in the package.json file. If you execute “npm install” the dependencies are installed in order, and as a result, “gulp-sass” is installed before node-sass.