Skip to content

node-gyp bug - yarn, as included in official docker node image, fails to install get-cursor-position #2828

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

Closed
mattkime opened this issue Mar 2, 2017 · 4 comments

Comments

@mattkime
Copy link

mattkime commented Mar 2, 2017

https://github.com/mattkime/get-cursor-position-fail/

Running docker build . from the repo directory results in -

[4/4] Building fresh packages...
error /home/mup/node_modules/get-cursor-position: Command failed.
Exit code: 127
Command: sh
Arguments: -c node-gyp rebuild
Directory: /home/mup/node_modules/get-cursor-position
Output:
sh: 1: node-gyp: not found

Modify Dockerfile to use npm instead and it works fine.

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

The official docker images, verified in both v7.6 and v7.7.1. Both use yarn v0.21.3

@mattkime mattkime changed the title BUG - yarn, as included in official docker node image, fails to install get-cursor-position node-gyp bug - yarn, as included in official docker node image, fails to install get-cursor-position Mar 3, 2017
@valeryq
Copy link

valeryq commented Mar 3, 2017

I have the same bug.

error /build/node_modules/bcrypt: Command failed.
Exit code: 127
Command: sh
Arguments: -c node-gyp rebuild
Directory: /build/node_modules/bcrypt
Output:
sh: 1: node-gyp: not found

With npm install its okey.

@Daniel15
Copy link
Member

Daniel15 commented Mar 4, 2017

Duplicate of #2266. A workaround for now is to run yarn global add node-gyp to your Docker image, before running yarn install.

@houssem-yahiaoui
Copy link

Even though sometimes this approach won't going to fully work, i've tested the solution over yarn 0.24.6 my solution was to replace bcrypt for bcryptjs same package, same methods and behaviour last one is more js compatible without any dependencies, and it works flawlessly over docker !

Hope this helps people with same issue.

@NeoLegends
Copy link

NeoLegends commented Nov 22, 2017

my solution was to replace bcrypt for bcryptjs same package, same methods and behaviour

This is often not desirable as the version using native code can use dedicated threads to calculate the bcrypt hash whereas the JS version cannot.

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

No branches or pull requests

5 participants