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

npm install hanging on Ubuntu 12.04 #898

Closed
noahgrant opened this issue Apr 27, 2015 · 23 comments
Closed

npm install hanging on Ubuntu 12.04 #898

noahgrant opened this issue Apr 27, 2015 · 23 comments

Comments

@noahgrant
Copy link

Hello!

Just today (or the last few days, perhaps), our CI builds started timing out, and they'd fail at the node sass install step:

> node-sass@1.2.3 install /home/ubuntu/code/web/node_modules/gulp-sass/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /home/ubuntu/code/web/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64/binding.node



> node-sass@1.2.3 postinstall /home/ubuntu/code/web/node_modules/gulp-sass/node_modules/node-sass
> node scripts/build.js

`linux-x64` exists; testing
Binary is fine; exiting

They'd just hang at the Binary is fine; exiting step. I've seen there are several issues that are similar to this, but I haven't really seen a solution. The CI is running:

  • Ubuntu 12.04
  • npm 2.1
  • node 0.10.32
  • node-sass v1.2.3

I still get the hanging if I upgrade to node-sass v2--that was my first inclination. But changing npm versions and node-sass versions have not seemed to make a difference. Did any other dependency have a release recently?

Thanks!!

Noah

@saper
Copy link
Member

saper commented Apr 28, 2015

your setup is pretty ancient... what happens if you enter the node-sass directory, launch node and enter this at the node's prompt:

var sass = require("./");

@noahgrant
Copy link
Author

well, if I do that locally on OS X I get undefined, I don't have an index.js file or anything in the node-sass version i'm running. But my problem is actually not on OS X, it's on my CI system, which is using ubuntu. unfortunately, I don't have access to those machines to run that command.

Also, my setup seems ancient, but I've actually had to keep it here because of all the instability with node sass--it didn't work on node 0.12 for a long time, node sass > 1.2.3 had installs like this failing all over the place, and some of the blame at the time was on npm v > 2. I would really like to upgrade everything, but I need things to be relatively stable. As I mentioned, I did upgrade to node-sass v2 and still saw the install failures on the CI. I also saw it while making the CI machine use npm v2.7.6, and I'm now trying to revert it back to using npm v1.4.x

@saper
Copy link
Member

saper commented Apr 28, 2015

undefined is good, if you say sass you should get some meaningful output.

It looks like the Binary is fine; exiting should be the last message printer by node-sass scripts. Maybe there are some problems with npm/the next package?

@noahgrant
Copy link
Author

That's my current hypothesis, and I'm still trying it out right now. So far, so good, and I'll go ahead and close this issue if it turns out to be the case. Thanks!

@xzyfer
Copy link
Contributor

xzyfer commented Apr 28, 2015

@saper is correct, it looks like the install process has completed before the freeze.

It's worth trying node-sass@beta. It addresses all the know stability and installation issues, as well as full iojs and 0.12 support.

@noahgrant
Copy link
Author

Thanks @xzyfer . After a brief install, using the latest gulp-sass (1.3.3), i get Bus error: 10. So I can't use node-sass@beta at this time.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 28, 2015

That's right, the latest gulp doesn't use the node-sass beta, but they support it in a branch. You can try

npm install dlmanning/gulp-sass#2.x

This is what I currently use in production.

@noahgrant
Copy link
Author

that's awesome, i'd love to test it out, but i'm still getting the Bus error: 10 message!

@xzyfer
Copy link
Contributor

xzyfer commented Apr 28, 2015

You might have to clear node_modules if you previously had gulp-sass installed

$ rm -r node_modules/
$ npm cache clean
$ npm install --save-dev dlmanning/gulp-sass#2.x

If you're still experiencing Bus error: 10 then that's something we need to look at.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 28, 2015

I would also update you npm. Older version had issues when backing onto git like you are here.

$ npm install -g npm
$ npm -v
2.6.1

@noahgrant
Copy link
Author

i'm actually afraid that the whole reason i'm running into this is because the CI machines are running a newer version of npm (2.7.6). we've run into this problem before with node-sass. our solution at the time was to go back to node-sass v1.2.3 and npm v1.4. That's why I'm trying to go back to that now.

I've followed your directions and got it to stop giving me the bus error! Thank you for that. However, that was locally on OS X, and I'm currently testing on our CI machine. I'll keep you posted. Thank you!

@noahgrant
Copy link
Author

Okay, so this is weird, but after running your commands above (clearing the cache and all), for whatever reason, gulp-sass v1.2.3 was installed again (with node sass 1.2.3). Bummer, too, I thought I had it fixed. But installing gulp-sass 2.x with the latest node-sass gave me the same Bus error: 10 again :-/

@xzyfer
Copy link
Contributor

xzyfer commented Apr 28, 2015

what's the contents of the package.json file running CI?

@noahgrant
Copy link
Author

it's quite long, actually, as it includes browserify transforms and shims and such. here are some of the modules that deal with lower level files that need node bindings:

"devDependencies": {
   "browser-sync": "^1.7.1",
   "gulp-sass": "git://github.com/dlmanning/gulp-sass.git#2.x",
    "gulp-svg-sprites": "^1.0.3", // uses node fibers and libxmljs
   "phantomjs": "~1.9.7-15",
    "watchify": "^3.1.0"
}

@noahgrant
Copy link
Author

@saper is correct, it looks like the install process has completed before the freeze.

i should also add that at times when it stalls it is not stalling at the 'exiting' statement, but further down after that install has succeeded, at this point:

gulp-sass@1.2.3 node_modules/gulp-sass
├── clone@0.1.19
├── map-stream@0.1.0
├── vinyl-sourcemaps-apply@0.1.4 (source-map@0.1.43)
└── node-sass@1.2.3 (get-stdin@3.0.2, object-assign@1.0.0, replace-ext@0.0.1, nan@1.7.0, cross-spawn@0.2.9, shelljs@0.3.0, mkdirp@0.5.0, meow@2.1.0, chalk@0.5.1, gaze@0.5.1, mocha@2.2.4)

where the next couple lines (on successful builds), would be:

/home/ubuntu/nvm/v0.10.32/bin/gulp -> /home/ubuntu/nvm/v0.10.32/lib/node_modules/gulp/bin/gulp.js
gulp@3.8.11 /home/ubuntu/nvm/v0.10.32/lib/node_modules/gulp
├── pretty-hrtime@0.2.2
├── interpret@0.3.10
├── deprecated@0.0.1
├── archy@1.0.0
├── tildify@1.0.0 (user-home@1.1.1)
├── minimist@1.1.1
├── v8flags@2.0.5 (user-home@1.1.1)
├── chalk@0.5.1 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── semver@4.3.3
// ...
// ...

This is why I still think it's a node-sass issue, even if it's an issue with the change in server environment.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 28, 2015

I'm simply failing to understand how node-sass@1.x is being installed. There must be a misconfiguration in the package.json.

Can you confirm there is only one node-sass folder in your node_module folder?

./node_modules/node-sass // should exist
./node_modules/gulp-sass/node_modules/node-sass // should not exists

@noahgrant
Copy link
Author

sorry, I should have been more clear--the error, I think, was from me not deleting my npm-shrinkwrap.json file before following your instructions, because i followed them with an npm install that installed gulp-sass@1.2.3 (which uses node-sass@1.2.3). I don't keep a node-sass version in my package.json, I only use whichever version gulp-sass uses. It was using node-sass@beta for the branch you told me about (#2.x), but I kept getting the Bus error: 10 with that setup so I couldn't use it.

@xzyfer
Copy link
Contributor

xzyfer commented May 4, 2015

So I the solution here is to use 3.0.0-beta.

At present you're unable to do to Bus error: 10. We've had some reports of this in Libsass 3.2.0 but nothing reproducible. Are you able to create a reduced test case reproducing this error?

@noahgrant
Copy link
Author

Unfortunately I haven't had a chance yet. All I know is that it doesn't like something in our sass--but we have a lot of sass files, and it's going to take me a minute to filter them out and find the issue.

@xzyfer
Copy link
Contributor

xzyfer commented Jun 11, 2015

Please update this issue if you have more information and we'll reopen it.

@hypery2k
Copy link

hypery2k commented Aug 1, 2015

with node-sass 3.2.0 it's failing with this combination:

  • node version: v0.12.4
  • npm version: 2.6.0

But works with this combination:

  • node version: v0.10.40
  • npm version: 1.4.28

@saper
Copy link
Member

saper commented Aug 1, 2015

@hypery2k can you follow our TROUBLESHOOTING.md guide and post the results, probably to a new issue (unless you get the very same symptoms as described in some other report)?

@xzyfer
Copy link
Contributor

xzyfer commented Aug 4, 2015

@hypery2k you probably want an npm > 2.10. There have been issues with life cycle scripts in earlier 2.x versions.

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

4 participants