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

node-gyp builds fail on bundled yarn #2266

Closed
bestander opened this issue Dec 15, 2016 · 10 comments · Fixed by #3240
Closed

node-gyp builds fail on bundled yarn #2266

bestander opened this issue Dec 15, 2016 · 10 comments · Fixed by #3240
Assignees
Labels

Comments

@bestander
Copy link
Member

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

bestander-mbp:bignum bestander$ node ~/work/yarn/artifacts/yarn-0.17.10.js add base85
yarn add v0.17.10
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
⠁
⠁
⠁
⠁
error /Users/bestander/work/temp/bignum/node_modules/bignum: Command failed.
Exit code: 127
Command: sh
Arguments: -c node-gyp configure build
Directory: /Users/bestander/work/temp/bignum/node_modules/bignum
Output:
sh: node-gyp: command not found
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Please mention your node.js, yarn and operating system version.

Node 6.9.1, Yarn 0.17.10

@bestander bestander self-assigned this Dec 15, 2016
@bestander
Copy link
Member Author

Reason - we use path.join(__dirname, '..', '..', 'bin', 'node-gyp-bin')) in source.
When everything is bundled in one file __dirname is incorrect.

@bestander
Copy link
Member Author

  • needed tests to prevent from __dirname breaking bundled builds later

@wyattjoh
Copy link

wyattjoh commented Mar 1, 2017

This is currently causing issues for our build, anything I can do to assist?

@terribleplan
Copy link

Our build has been broken since docker started including this and we stopped running npm install -g yarn. I understand that it is not recommended, but at least it actually worked.

Paging @Daniel15 since he seems like a cool guy ;)

@bestander
Copy link
Member Author

Thanks the team is in the loop, we'll figure something out

@terribleplan
Copy link

Cool, just wanted to make sure. We have a workaround in place, but it was pretty bad/interesting/weird/fun to have our build and dev workflow break when it wasn't our fault.

@Daniel15
Copy link
Member

Daniel15 commented Mar 2, 2017

Based on nodejs/docker-node#346, it sounds like running yarn global add node-gyp is a viable workaround for now. Running that before doing yarn install should fix the issue.

Paging @Daniel15 since he seems like a cool guy ;)

😊

@terribleplan
Copy link

terribleplan commented Mar 2, 2017

 RUN rm -rf node_modules/

+# This line should be removed when the included version of yarn in the container
+# is no longer broken https://github.com/yarnpkg/yarn/issues/2266
+RUN yarn global add node-gyp
+
 RUN yarn

😉

@bestander
Copy link
Member Author

bestander commented Mar 2, 2017

The bundled build could include a small bootstrap section that would do yarn global add node-gyp and also generate node-gyp-bin folder.
If node-gyp is not in the PATH

@bestander
Copy link
Member Author

Oh, and as always, this could be a cool contribution to send a PR for!

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

Successfully merging a pull request may close this issue.

4 participants