question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install sharp in docker

See original GitHub issue

This is quite strange, I was able to install sharp with npm, but since today in the morning I’m getting this error. I found a similar issue, but having doubts it can be connection error, as I have tried all day long and not working

Version of sharp that I’m trying to use: “sharp”: “^0.21.0”,

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-linux-x64.tar.gz
--
  | /usr/src/app/node_modules/sharp/install/libvips.js:80
  | throw new Error(`Status ${response.statusCode}`);
  | ^
  |  
  | Error: Status 403
  | at /usr/src/app/node_modules/sharp/install/libvips.js:80:17
  | at f (/usr/src/app/node_modules/once/once.js:25:25)
  | at ClientRequest.protocol.request.res (/usr/src/app/node_modules/simple-get/index.js:63:5)
  | at Object.onceWrapper (events.js:277:13)
  | at ClientRequest.emit (events.js:189:13)
  | at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
  | at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
  | at TLSSocket.socketOnData (_http_client.js:442:20)
  | at TLSSocket.emit (events.js:189:13)
  | at addChunk (_stream_readable.js:284:12)
  | make: Entering directory '/usr/src/app/node_modules/sharp/build'
  | TOUCH Release/obj.target/libvips-cpp.stamp
  | CXX(target) Release/obj.target/sharp/src/common.o
  | ../src/common.cc:25:22: fatal error: vips/vips8: No such file or directory
  | #include <vips/vips8>
  | ^
  | compilation terminated.
  | sharp.target.mk:126: recipe for target 'Release/obj.target/sharp/src/common.o' failed
  | make: Leaving directory '/usr/src/app/node_modules/sharp/build'
  | make: *** [Release/obj.target/sharp/src/common.o] Error 1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
thiagomfrancacommented, Mar 28, 2019

I’ve the exact same error as above in Elastic Beanstalk environment.

  > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
  
  info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linux-x64.tar.gz
  /tmp/deployment/application/node_modules/sharp/install/libvips.js:86
            throw new Error(`Status ${response.statusCode}`);
            ^
  
  Error: Status 403
      at /tmp/deployment/application/node_modules/sharp/install/libvips.js:86:17
      at f (/tmp/deployment/application/node_modules/once/once.js:25:25)
      at ClientRequest.protocol.request.res (/tmp/deployment/application/node_modules/simple-get/index.js:63:5)
      at Object.onceWrapper (events.js:277:13)
      at ClientRequest.emit (events.js:189:13)
      at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
      at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
      at TLSSocket.socketOnData (_http_client.js:442:20)
      at TLSSocket.emit (events.js:189:13)
      at addChunk (_stream_readable.js:284:12)
  make: Entering directory `/tmp/deployment/application/node_modules/sharp/build'
    TOUCH Release/obj.target/libvips-cpp.stamp
    CXX(target) Release/obj.target/sharp/src/common.o
  ../src/common.cc:25:22: fatal error: vips/vips8: No such file or directory
   #include <vips/vips8>
                        ^
  compilation terminated.
  make: *** [Release/obj.target/sharp/src/common.o] Error 1
  make: Leaving directory `/tmp/deployment/application/node_modules/sharp/build'
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/opt/elasticbeanstalk/node-install/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
  gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
  gyp ERR! System Linux 4.14.97-74.72.amzn1.x86_64
  gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v10.15.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v10.15.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
  gyp ERR! cwd /tmp/deployment/application/node_modules/sharp
  gyp ERR! node -v v10.15.1
  gyp ERR! node-gyp -v v3.8.0
  gyp ERR! not ok 
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! sharp@0.22.0 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the sharp@0.22.0 install script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.```
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error installing Sharp in docker container - npm
Any help greatly appreciated! Docker image is incredibly simple: FROM node:12.13.0-alpine AS alpine WORKDIR ...
Read more >
Error to build AWS Lambda Node 14arm64 with Sharp on a ...
I'm changing a node setup from node 14 x64 to node 14 arm64 in an Amazon ECR (Docker) entry. It build with no...
Read more >
install-sharp
Using Next.js' built-in Image Optimization requires sharp as a dependency. You are seeing this error because your OS was unable to install sharp...
Read more >
[Solved]-Express Sharp install via Docker issue-node.js
[Solved]-Express Sharp install via Docker issue-node.js ... Alpine uses musl for its C library. You can either use a different non-alpine based image...
Read more >
jorgehortelano/node-sharp Dockerfile
Sharp library compilation and instalation for docker Alpine ... su node \ && npm install sharp@${SHARP_VERSION} --g --production --unsafe-perm \ && chown ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found