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
Reason - we use path.join(__dirname, '..', '..', 'bin', 'node-gyp-bin')) in source.
When everything is bundled in one file __dirname is incorrect.
This is currently causing issues for our build, anything I can do to assist?
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 ;)
Thanks the team is in the loop, we'll figure something out
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.
Based on https://github.com/nodejs/docker-node/issues/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 ;)
๐
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
:wink:
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
Oh, and as always, this could be a cool contribution to send a PR for!
Most helpful comment
Based on https://github.com/nodejs/docker-node/issues/346, it sounds like running
yarn global add node-gypis a viable workaround for now. Running that before doingyarn installshould fix the issue.๐