Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postinstall fails with iojs-1.4.1 #715

Closed
wants to merge 1 commit into from
Closed

postinstall fails with iojs-1.4.1 #715

wants to merge 1 commit into from

Conversation

hmalphettes
Copy link

I encountered the same error than kevinSuttle here: #693 (comment)

iojs-1.4.1 installed via nvm.

➜  tmp  npm i node-sass
|
> node-sass@2.0.1 install /Users/hugues/proj/tmp/node_modules/node-sass
> node scripts/install.js

Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.0.1/darwin-x64-iojs-1.4/binding.node

> node-sass@2.0.1 postinstall /Users/hugues/proj/tmp/node_modules/node-sass
> node scripts/build.js

module.js:322
    throw err;
          ^
Error: Cannot find module '/Users/hugues/proj/tmp/node_modules/node-sass/node_modules/pangyp/bin/node-gyp'
    at Function.Module._resolveFilename (module.js:320:15)
    at Function.Module._load (module.js:262:25)
    at Function.Module.runMain (module.js:485:10)
    at startup (node.js:112:16)
    at node.js:863:3
Build failed

On my Macos machine there is no homebrew installation of nodejs or iojs; it is important because homebrew does not install the proper patched npm for iojs and one ends-up having to use pangyp as an alternative to node-gyp when that happens.

The stack trace shows that pangyp, a devDependency, was not installed.
So I moved pangyp to a runtime dependency and got past that problem: #714 (comment)

However the sass binary produced remained incompatible.

I have reverted the use of pangyp (https://github.com/hmalphettes/node-sass/commit/5a113952bf517ebb96f50204431b8f2d8844500d) and put back node-gyp and everything is working like a charm.

@am11
Copy link
Contributor

am11 commented Feb 27, 2015

Thanks for your contribution. I am in the middle of changing this build related stuff in another PR.

There are two issues with this PR:

1 - You are assuming that end user will already have node-gyp globally installed, which might not be the case. This is exactly what we were assuming before I added pangyp as dependency (as io.js appeared at the same time).

2 -

..put back node-gyp and everything is working like a charm.

Yes it seems like it (I am actually surprised, last time I tried building io.js binary, node-gyp just said "no!"). Even though things are looking pretty promising, we should not make any assumption unless this is merged: nodejs/node-gyp#564. Till then, pangyp is the build tool of choice.

@hmalphettes
Copy link
Author

@am11 thanks for your attention.

I had not realised that node-gyp could ever be not installed when running npm install. I'll research that.

Yes I can't wait for nodejs/node-gyp#564 and the upstream nodejs/node#493 to be resolved.

Should we close this PR then?

@am11
Copy link
Contributor

am11 commented Feb 27, 2015

Should we close this PR then?

Yes. For now, sticking with pangyp would be make sense until those issues in up streams are sorted out.

We had actually achieved a quite stable build process before io.js days. The aim is to re-achieve that stability. We are also trying to avoid manual building step on end terminals as much as possible (in favour of pre-build binaries).

@am11
Copy link
Contributor

am11 commented Feb 27, 2015

FYI: #717.

jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this pull request Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants