Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 [email protected] fixes the issue. https://github.com/brianc/node-pg-native/issues/27

However, I'm running [email protected].

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

like image 779
bartonm Avatar asked Oct 11 '15 18:10

bartonm


1 Answers

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.

like image 92
im3r3k Avatar answered Nov 18 '22 08:11

im3r3k