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

Can't install sharp on Amazon Linux AMI #879

Closed
kiran-redhat opened this issue Jul 25, 2017 · 6 comments
Closed

Can't install sharp on Amazon Linux AMI #879

kiran-redhat opened this issue Jul 25, 2017 · 6 comments
Labels

Comments

@kiran-redhat
Copy link

Unable to install sharp on Amazon Linux AMI (4.9.17-8.31.amzn1.x86_64) related release notes:
https://aws.amazon.com/amazon-linux-ami/2017.03-release-notes/.

More info:
4497 verbose about to build /home/myusername/BackstopJS/node_modules/sharp
4498 info build /home/myusername/BackstopJS/node_modules/sharp
4499 info linkStuff [email protected]
4500 silly linkStuff [email protected] has /home/myusername/BackstopJS/node_modules as its parent node_modules
4501 verbose linkBins [email protected]
4502 verbose linkMans [email protected]
4503 verbose rebuildBundles [email protected]
4504 verbose rebuildBundles [ '.bin', 'caw', 'color', 'got', 'nan', 'semver', 'tar' ]
4505 info install [email protected]
4506 verbose unsafe-perm in lifecycle true
4507 info [email protected] Failed to exec install script
4508 verbose unlock done using /home/myusername/.npm/_locks/sharp-724c992e50a0ae1d.lock for /home/myusername/BackstopJS/node_modules/sharp
4509 verbose stack Error: [email protected] install: node-gyp rebuild
4509 verbose stack Exit status 1
4509 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
4509 verbose stack at emitTwo (events.js:87:13)
4509 verbose stack at EventEmitter.emit (events.js:172:7)
4509 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
4509 verbose stack at emitTwo (events.js:87:13)
4509 verbose stack at ChildProcess.emit (events.js:172:7)
4509 verbose stack at maybeClose (internal/child_process.js:862:16)
4509 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)
4510 verbose pkgid [email protected]
4511 verbose cwd /home/myusername/BackstopJS
4512 error Linux 4.9.17-8.31.amzn1.x86_64
4513 error argv "/usr/bin/node" "/usr/bin/npm" "install"
4514 error node v4.8.4
4515 error npm v2.15.11
4516 error code ELIFECYCLE
4517 error [email protected] install: node-gyp rebuild
4517 error Exit status 1
4518 error Failed at the [email protected] install script 'node-gyp rebuild'.
4518 error This is most likely a problem with the sharp package,
4518 error not with npm itself.
4518 error Tell the author that this fails on your system:

@lovell
Copy link
Owner

lovell commented Jul 25, 2017

Hello, are all the prerequisites installed?

https://aws.amazon.com/amazon-linux-ami/2017.03-packages/

  • gcc-4.8.3
  • python27-2.7.12

@kiran-redhat
Copy link
Author

kiran-redhat commented Jul 25, 2017

Thank you for quick response @lovell .Yes, I have below:
Python 2.7.12
gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)
Node v4.8.4

@lovell
Copy link
Owner

lovell commented Jul 26, 2017

Thank you.

It looks like the underlying error message is somehow being suppressed. I'll try running the latest Amazon AMI image with Docker to see if I can reproduce this locally.

In the meantime, are you able to try with a more recent versions of Node (and therefore node-gyp) to see if they provide more useful error output?

@lovell lovell added triage and removed question labels Jul 26, 2017
@lovell
Copy link
Owner

lovell commented Jul 26, 2017

Here's what I used to get Node v4.8.4 installed on Amazon Linux 2017.03 and ready for use with native modules (tested via docker run -it --rm amazonlinux:2017.03):

curl --silent --location https://rpm.nodesource.com/setup_4.x | bash
yum install -y gcc-c++ nodejs
npm install sharp

Perhaps gcc-c++, a node-gyp requirement, is the missing information here.

@lovell lovell added question and removed triage labels Jul 26, 2017
@kiran-redhat
Copy link
Author

kiran-redhat commented Jul 27, 2017

Hey @lovell , thank you for having a look. Looks like Amazon Linux AMI doesn't have gcc-c++, sharp install fine after sudo yum install gcc-c++

Closing issue.

@klemensz
Copy link

klemensz commented Aug 3, 2017

For anybody having problems with node-gyp rebuild failing with sharp on subsequent npm installs on Elastic Beanstalk and Amazon Linux, take a look at this issue: ember-fastboot/fastboot-aws#4 (comment)

(TL;DR: Missing permissions for user 'nodejs' for the directory /tmp/.npm)

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

No branches or pull requests

3 participants