Node-sass throw error when updating node to 4.0.0

I am developing an ionic application and I am using sass. when I upgrade node version to version 4.0.0, an error about node-sass is thrown. error - hit:

ionic $ /Applications/My-Project/nearbook/nearbooks_ionic/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 (/Applications/My-Project/nearbook/nearbooks_ionic/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:22:11)
    at Object.<anonymous> (/Applications/My-Project/nearbook/nearbooks_ionic/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:188:23)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Applications/My-Project/nearbook/nearbooks_ionic/node_modules/gulp-sass/index.js:3:17)
    at Module._compile (module.js:460:26)

I tried reinstalling all my node_modules (I delete the node_modules folder and reboot node install) or run node rebuild node-sass, but it still doesn't work.

when I downgrade the node version to 0.12.7 and reinstall all node_modules, my problem is solved.

so I assume that something is wrong when node 4.0 is compiling node-sass.

Does anyone know how to fix this?

+4
source share
1 answer

make sure you use the gulp-sass 2.0.4latestgulp-sass

npm install --save-dev gulp-sass

node-sass 3.3.2, node 4.0 https://twitter.com/nodesass/status/641607400651288576

+12

Source: https://habr.com/ru/post/1606525/


All Articles