Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

node-sass 3.3.3 does not seem to work on Node 4 #1185

Closed
mikemaccana opened this issue Sep 30, 2015 · 7 comments
Closed

node-sass 3.3.3 does not seem to work on Node 4 #1185

mikemaccana opened this issue Sep 30, 2015 · 7 comments

Comments

@mikemaccana
Copy link

Per #1122, I am using the latest node-sass on the current stable node release.

However building fails on pangyp:

$ npm install --save node-sass@latest
npm WARN prefer global [email protected] should be installed with -g

> [email protected] install /var/www/myapp/node_modules/mylib/node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js

Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/linux-x64-node-4.1/binding.node

> [email protected] install /var/www/myapp/node_modules/mylib/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /var/www/myapp/node_modules/mylib/node_modules/node-sass/vendor/linux-x64-46/binding.node

> [email protected] postinstall /var/www/myapp/node_modules/mylib/node_modules/gulp-sass/node_modules/node-sass
> node scripts/build.js

module.js:338
    throw err;
    ^

Error: Cannot find module '/var/www/myapp/node_modules/mylib/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/bin/node-gyp'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3
Build failed

> [email protected] postinstall /var/www/myapp/node_modules/mylib/node_modules/spawn-sync
> node postinstall


> [email protected] postinstall /var/www/myapp/node_modules/mylib/node_modules/node-sass
> node scripts/build.js

` /var/www/myapp/node_modules/mylib/node_modules/node-sass/vendor/linux-x64-46/binding.node ` exists.
 testing binary.
Binary is fine; exiting.
[email protected] node_modules/node-sass/node_modules/ansi-regex -> node_modules/gulp-sass/node_modules/ansi-regex
[email protected] node_modules/node-sass/node_modules/ansi-styles -> node_modules/gulp-sass/node_modules/ansi-styles
[email protected] node_modules/node-sass/node_modules/has-ansi -> node_modules/gulp-sass/node_modules/has-ansi
[email protected] node_modules/node-sass/node_modules/nan -> node_modules/gulp-sass/node_modules/nan
[email protected] node_modules/node-sass/node_modules/object-assign -> node_modules/gulp-sass/node_modules/object-assign
[email protected] node_modules/node-sass/node_modules/strip-ansi -> node_modules/gulp-sass/node_modules/strip-ansi
[email protected] node_modules/node-sass/node_modules/supports-color -> node_modules/gulp-sass/node_modules/supports-color
[email protected] node_modules/node-sass/node_modules/chalk -> node_modules/gulp-sass/node_modules/chalk
[email protected] /var/www/myapp/node_modules/mylib
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]
└─┬ [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   └─┬ [email protected]
  │ │     └── [email protected]
  │ └─┬ [email protected]
  │   └── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ └─┬ [email protected]
  │   └── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ └─┬ [email protected]
  │   └── [email protected]
  └─┬ [email protected]
    ├── [email protected]
    └─┬ [email protected]
      ├─┬ [email protected]
      │ ├─┬ [email protected]
      │ │ └─┬ [email protected]
      │ │   ├── [email protected]
      │ │   ├── [email protected]
      │ │   └── [email protected]
      │ ├── [email protected]
      │ └── [email protected]
      ├─┬ [email protected]
      │ └─┬ [email protected]
      │   └── [email protected]
      ├── [email protected]
      └── [email protected]

node-sass then complains it is doesn't have a working binary:

$ gulp
/var/www/myapp/node_modules/mylib/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 (/var/www/myapp/node_modules/mylib/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:22:11)
    at Object.<anonymous> (/var/www/myapp/node_modules/mylib/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:188:23)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452: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> (/var/www/myapp/node_modules/mylib/node_modules/gulp-sass/index.js:3:17)
    at Module._compile (module.js:434:26)
@Lothiraldan
Copy link

Same error here

@saper
Copy link
Member

saper commented Sep 30, 2015

As one can see from the npm output you are getting node-sass 2.1.1, not 3.3.3. You need to update your project dependencies, since the newest gulp-sass uses the newest node-sass as well.

@mikemaccana
Copy link
Author

Yep @saper you're correct: for anyone else that has this problem I had both 3.3.3 installed top level and 2.1.1 installed deeper in the same dependency tree. I cleaned out my tree and used npm v3 (which installs to the top level by default) to reduce the redundancy. Sorry for wasting your time!

@ericdiviney
Copy link

Could you elaborate more on how you "cleaned out your tree"? I seem to be having the same problem that you did, but I'm not sure what "cleaning out the tree" means.

Thanks!

@saper
Copy link
Member

saper commented Oct 16, 2015 via email

@andfinally
Copy link

Thanks, cleaning out node_modules and reinstalling everything fixed it for me.

@saper
Copy link
Member

saper commented Jul 19, 2017

@Lothiraldan clean your dependencies as indicated above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants