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

Unable to install node-sass 3.4.2 running node 4.2.1 & OS X 10.11.1 #1265

Closed
jpaas opened this issue Nov 12, 2015 · 34 comments
Closed

Unable to install node-sass 3.4.2 running node 4.2.1 & OS X 10.11.1 #1265

jpaas opened this issue Nov 12, 2015 · 34 comments

Comments

@jpaas
Copy link

jpaas commented Nov 12, 2015

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.

@jpaas
Copy link
Author

jpaas commented Nov 12, 2015

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

@stevenla
Copy link

+1 I'm seeing this issue too

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

@awochna
Copy link

awochna commented Nov 12, 2015

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

@danauclair
Copy link

npm/nopt#54

@kenips
Copy link

kenips commented Nov 12, 2015

@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.

@ackernaut
Copy link

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

OS X 10.11.1
node 0.12.7
npm 2.14.2

> node-sass@3.4.2 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! node-sass@3.4.2 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.4.2 install script 'node scripts/install.js'.

@dseeto
Copy link

dseeto commented Nov 12, 2015

@ackernaut: 👍 Seeing the same thing.

@kalebtrotter
Copy link

+1 @ackernaut and @dseeto

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

@mattlqx
Copy link

mattlqx commented Nov 12, 2015

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

@joshstrange
Copy link

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 gulp-sass@1.3.3 which used node-sass@2.1.1 so I tried upgrading to gulp-sass@2.0.4 which uses node-sass@3.4.2 and I'm getting the same error

@munkyjunky
Copy link

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.

@kenips
Copy link

kenips commented Nov 12, 2015

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

@ackernaut
Copy link

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

@joshstrange
Copy link

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

@ackernaut
Copy link

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

@xzyfer
Copy link
Contributor

xzyfer commented Nov 12, 2015

@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.

@jpaas
Copy link
Author

jpaas commented Nov 12, 2015

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

@goncalvesjoao
Copy link

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

@xzyfer
Copy link
Contributor

xzyfer commented Nov 12, 2015

I am unable to reproduce this on OSX node 4.2.1.

➜  tmp  npm install node-sass
-
> spawn-sync@1.0.14 postinstall /Users/michael/tmp/node_modules/node-sass/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

-
> node-sass@3.4.2 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

> node-sass@3.4.2 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.
node-sass@3.4.2 node_modules/node-sass
├── get-stdin@4.0.1
├── async-foreach@0.1.3
├── nan@2.1.0
├── mkdirp@0.5.1 (minimist@0.0.8)
├── chalk@1.1.1 (escape-string-regexp@1.0.3, supports-color@2.0.0, ansi-styles@2.1.0, strip-ansi@3.0.0, has-ansi@2.0.0)
├── npmconf@2.1.2 (ini@1.3.4, uid-number@0.0.5, inherits@2.0.1, once@1.3.2, semver@4.3.6, osenv@0.1.3, nopt@3.0.6, config-chain@1.1.9)
├── glob@5.0.15 (path-is-absolute@1.0.0, inherits@2.0.1, once@1.3.2, inflight@1.0.4, minimatch@3.0.0)
├── gaze@0.5.2 (globule@0.1.0)
├── meow@3.5.0 (trim-newlines@1.0.0, object-assign@4.0.1, camelcase-keys@1.0.0, minimist@1.2.0, loud-rejection@1.1.0, redent@1.0.0, normalize-package-data@2.3.5, read-pkg-up@1.0.1)
├── cross-spawn@2.0.0 (cross-spawn-async@2.0.0, spawn-sync@1.0.14)
├── request@2.65.0 (aws-sign2@0.6.0, forever-agent@0.6.1, tunnel-agent@0.4.1, oauth-sign@0.8.0, caseless@0.11.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, tough-cookie@2.2.0, node-uuid@1.4.6, qs@5.2.0, combined-stream@1.0.5, mime-types@2.1.7, form-data@1.0.0-rc3, http-signature@0.11.0, hawk@3.1.1, bl@1.0.0, har-validator@2.0.2)
├── node-gyp@3.0.3 (graceful-fs@4.1.2, semver@5.0.3, osenv@0.1.3, nopt@3.0.6, minimatch@1.0.0, which@1.2.0, fstream@1.0.8, glob@4.5.3, tar@1.0.3, rimraf@2.4.3, path-array@1.0.0, npmlog@1.2.1)
└── sass-graph@2.0.1 (yargs@3.29.0, lodash@3.10.1)
➜  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.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 12, 2015

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

@goncalvesjoao
Copy link

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.

@jpaas
Copy link
Author

jpaas commented Nov 12, 2015

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

@xzyfer
Copy link
Contributor

xzyfer commented Nov 12, 2015

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.

@goncalvesjoao
Copy link

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"

@xzyfer
Copy link
Contributor

xzyfer commented Nov 12, 2015

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

@jpaas
Copy link
Author

jpaas commented Nov 12, 2015

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.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 12, 2015

👍 thanks for being so thorough @jpaas.

@xzyfer xzyfer closed this as completed Nov 12, 2015
@worldask
Copy link

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

@edfuh
Copy link

edfuh commented May 16, 2016

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

@brainix
Copy link

brainix commented Jul 20, 2016

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

@saper
Copy link
Member

saper commented Jul 20, 2016

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

@brainix
Copy link

brainix commented Jul 20, 2016

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

@saper
Copy link
Member

saper commented Jul 20, 2016

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

@maptechnica
Copy link

maptechnica commented Apr 15, 2017

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

npm rebuild node-sass
rm -rf node_modules
npm i

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