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.

Linux Error installing sharp

See original GitHub issue

I have been working on development on the mac and it seems to be working fine so I thought on deployment things could be just fine since the docs are pretty much similar for installation.

Unfortunately, I am getting the following error log:

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linux-x64.tar.gz
ERR! sharp EACCES: permission denied, open '/home/ricardo/_app/node_modules/sharp/9986-libvips-8.7.4-linux-x64.tar.gz'
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ricardo/_app/node_modules/sharp/build'
gyp ERR! System Linux 4.4.0-127-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ricardo/_app/node_modules/sharp
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN la-therapy@1.0.2 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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.

is the building mainly failing because of the Linux version no being drawing or something else is happening here?

I am currently using Ubuntu 16.04 and I tried installing using sudo npm install --save sharp I also tried using npm install --build-from-source

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
EFXPROMediacommented, Mar 27, 2019

Strange thing is that the user I tried the install has is not the root user but it has sudo privileges and would install about anything without any problem also I tried using the service terminal and it had the same issue.

At the end your solution worked using npm install --unsafe-perm I am not sure about this flag capability I could not find it as a reference on npm but thanks for all

0reactions
lovellcommented, Sep 4, 2019

I recommend avoiding the use of sudo/root when installing via npm, but if you do, npm’s --unsafe-perm flag is required, as is the case for all native modules and not just sharp.

Read more comments on GitHub >

github_iconTop Results From Across the Web

installing npm modules on ubuntu gives me an error
i got the following error when i tried to install an npm package called sharp. npm install -g sharp npm WARN checkPermissions Missing...
Read more >
sharp EACCES: permission denied on CentOS/RHEL 7 - FIXED
A solution to sharp EACCES permission denied error while installing the nodejs package. While installing the Nodejs package Browsertime, I got the.
Read more >
Error installing client on jetson nano : Error: sharp@0.29.1 - Help
When installing the edge impulse client i get error installing client on jetson nano : Error: sharp@0.29.1. How can i overcome this error?...
Read more >
install-sharp - Next.js
You are seeing this error because your OS was unable to install sharp ... For example, if you're using Windows, try using WSL...
Read more >
sharp - npm
Most modern macOS, Windows and Linux systems running Node.js >= 14.15.0 do not require any additional install or runtime dependencies.
Read more >

github_iconTop Related Medium Post

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