6

It correctly launches the browser emulator with ionic serve.

However, gulp watch crashes on this exception...

    /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`?

Strangely though npm rebuild node-sass trips over itself with this error

gyp: .node-gyp/4.1.2/common.gypi not found

The issue was discussed here, suggests that npm@2.14.4 fixes the issue. https://github.com/brianc/node-pg-native/issues/27

However, I'm running npm@2.14.6.

I must be overlooking something trivial here or in issue 27. Can anyone see what it is?

bartonm
  • 1,600
  • 3
  • 18
  • 30

1 Answers1

5

UPDATE: A similar issue can occur with grunt-sass.

I fixed it by removing the version restriction from gulp, gulp-sass and reinstalling the modules:

  1. Move/Remove all modules in the project's node_modules folder (the "locally" installed modules)
  2. In package.json, replace the version numbers next to gulp and gulp-sass with "*".
  3. (step unnecessary) For good measure, add node-gyp and node-sass to the dependencies, also with "*".
  4. Run npm install

As a guide, you can use this stackoverflow link about updating dependencies.

Basically you need to make sure that gulp-sass uses node-gyp + node-sass instead of pangyp.

I wanted to start my first node project in a clean state so struggled with this problem for a while. Downgrading didn't work.

The problem seemed a conflict with the forced versioning of gulp-sass in package.json. gulp-sass probably relied on pangyp instead of node-gyp at some point and now that pangyp is depreciated, it somehow causes a conflict.

I believe the versions are there to protect you, especially in production. From my experience, (which is about 1 weeks now) updating some modules a project uses is not all that risky.

Community
  • 1
  • 1
im3r3k
  • 503
  • 1
  • 7
  • 14
  • 1
    Thank you very much, I can confirm setting sass version to "*" works also for grunt as it seems to be npm versioning issue. Step 3 was not necessary. – Michał W. Oct 12 '15 at 13:28