Node-sass: Unable to install node-sass 3.4.2 running node 4.2.1 & OS X 10.11.1

Created on 12 Nov 2015  ยท  34Comments  ยท  Source: sass/node-sass

I performed the troubleshooting steps and put the output here https://gist.github.com/jpaas/7f3d9c1079c451f18345

It hangs during the post install scripts. You can see where I had to ctrl-C to continue.

I did upgrade my version of node but I did an npm rebuild and it completed without any errors.

Bug - Maybe OS - OSX npm install

Most helpful comment

I solved this by deleting ~/.node-gyp and running npm update

All 34 comments

So it seems to install an invalid binding.node, but even when I replace the binding.node with one that works, I still can't complete an npm install

+1 I'm seeing this issue too

npm ERR! node v4.1.2
npm ERR! npm  v2.14.4

Also seeing this problem on Ubuntu 14.04, so I don't think it's OSX-specific.

@awochna @danauclair regarding nopt it's a different issue from the one @jpass has. Check his logs. nopt 3.0.5 wasn't published 2 hours ago.

I am seeing a similar issue. I am currently running:

OS X 10.11.1
node 0.12.7
npm 2.14.2

> [email protected] install /.../node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js

/.../node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/node_modules/nopt/lib/nopt.js:210
    if (t && ((type.name && t.type.name) ?
                   ^
TypeError: Cannot read property 'name' of null
    at validate (/.../node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/node_modules/nopt/lib/nopt.js:210:20)
    at validate (/.../node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/node_modules/nopt/lib/nopt.js:179:11)
    at /.../node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/node_modules/nopt/lib/nopt.js:101:12
    at Array.map (native)
    at /.../node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/node_modules/nopt/lib/nopt.js:67:15
    at Array.forEach (native)
    at Function.clean (/.../node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/node_modules/nopt/lib/nopt.js:55:21)
    at /.../node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/npmconf.js:411:10
    at Array.forEach (native)
    at validate (/.../node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/npmconf.js:410:11)
npm ERR! Darwin 15.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node scripts/install.js'.

@ackernaut: :+1: Seeing the same thing.

+1 @ackernaut and @dseeto

EDIT: I'm on a Debian 8 box, so it's not OSX specific.

Same here...

npm ERR! Linux 3.16.0-41-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.2
npm ERR! npm v2.14.7

I'm seeing the same error as @ackernaut

OS X 10.10.5 AND Debian Jessie
npm ERR! node v0.12.7
npm ERR! npm v2.11.3

We were running [email protected] which used [email protected] so I tried upgrading to [email protected] which uses [email protected] and I'm getting the same error

Also seeing this issue, running on a Windows OS

npm ERR! node v0.12.7
npm ERR! npm  v2.11.3

Worked fine up until the update to 3.4.2.

If you're seeing what @ackernaut sees, the issue has been fixed in https://github.com/npm/nopt/commit/8900f8e3f039d5131c600700994e51f7b312c5fe. It's not related to what @jpaas posted though.

Thanks @kenips for the update! Iโ€™ll keep an eye out for an update to gulp-sass.

@ackernaut I don't think you will need an update, it appears to be working now without a version bump

@joshstrange ah, makes sense, the versioning syntax :) thanks

@jpaas Looking at your output it looks like you're killing the install process. Why is that?

As far as I can tell you're simply not installing the binary at all.

I'm killing it because it hangs. I tried leaving it once for 20-30 minutes, but it always gets stuck at that spot.

+1
gulp-sass v2.0.4
node v5.0.0
npm v3.3.6

I am unable to reproduce this on OSX node 4.2.1.

โžœ  tmp  npm install node-sass
-
> [email protected] postinstall /Users/michael/tmp/node_modules/node-sass/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

-
> [email protected] install /Users/michael/tmp/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /Users/michael/tmp/node_modules/node-sass/vendor/darwin-x64-46/binding.node

> [email protected] postinstall /Users/michael/tmp/node_modules/node-sass
> node scripts/build.js

` /Users/michael/tmp/node_modules/node-sass/vendor/darwin-x64-46/binding.node ` exists.
 testing binary.
Binary is fine; exiting.
[email protected] node_modules/node-sass
โ”œโ”€โ”€ [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], [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])
โžœ  tmp  ./node_modules/.bin/node-sass --version
node-sass   3.4.2   (Wrapper)   [JavaScript]
libsass     3.3.2   (Sass Compiler) [C/C++]

The issue you're seeing is because you're killing npm before node-sass finishes installing. There may be a larger issue that npm is stalling when installing node-sass but I am unable to reproduce this.

@goncalvesjoao do not +1. If you want to contribute please follow the troubleshooting guide like @jpaas did.

thanks to @danauclair comment, I added "nopt": "3.0.6" (that fixes the "TypeError: Cannot read property 'name' of null"), to my package.json and now everything is fine.

@xzyfer do you think I just need to be more patient and let it run longer?

It shouldn't take more than a few seconds. It's possible you're having a networking issue that preventing or slowing down the download. If you have the ability to inspect you network traffic it would be worth seeing what's happening.

you're right @xzyfer I got hasted, anyway for me it was a matter of forcing the latest nopt version that fixes the "TypeError: Cannot read property 'name' of null" that was occurring to me during "npm install"

No worries @goncalvesjoao. There are two separate issues being discussed here. The nopt issue is fixed now. Running npm install should fix things.

I just tried the troubleshooting procedure again for about the 5th time today, but this time when I ran npm install node-sass it finished in less than 1s and I am now able to do this...

$ ./node_modules/.bin/node-sass --version
node-sass   3.4.2   (Wrapper)   [JavaScript]
libsass     3.3.2   (Sass Compiler) [C/C++]

So as far as I'm concerned, it seems to have resolved itself.

:+1: thanks for being so thorough @jpaas.

I solved this problem by updating my gcc from 4.4 to 4.7.

I solved this by deleting ~/.node-gyp and running npm update

The fix that worked for me: $ npm install node-sass --save --unsafe-perm. Some weird permissions issue?

@brainix unsafe-perm is needed if you run a whole thing as root (generally you don't need to)

Thanks for the tip, @saper. I really don't know what I'm talking about.

@brainix you might want to check the npm documentation on permissions. It's a bit magic.

Per @justin808 in this thread, I fixed this with the following:

npm rebuild node-sass
rm -rf node_modules
npm i
Was this page helpful?
0 / 5 - 0 ratings