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.

sharp: Command failed

See original GitHub issue

Description

env

  1. win7 64
  2. node@10.15.x
  3. npm@6.4.1
  4. yarn@1.15.1
  5. python@3.7.x

Steps to reproduce

  1. gridsome create my-gridsome-site. error report:
Error: Failed to install dependencies with yarn  Please enter my-gridsome-site directory and install dependencies with yarn or npm manually.
 Exit code 1
 at ChildProcess.child.on.code...
...
  1. cd my-gridsome-site
  2. yarn install. error report:
error E:\my-gridsome-site\node_modules\sharp: Command failed.
Command: (node install/libvips && node install/dll-copy && prebuild-install) ||
(node-gyp rebuild && node install/dll-copy)
...

why?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:14
  • Comments:63 (5 by maintainers)

github_iconTop GitHub Comments

93reactions
u12206050commented, Sep 24, 2019

So after some digging/searching and trying these steps solved it for me:

rm -rf /Users/{username}/.npm/_libvips brew install vips // If this command throws some error about could not download cfitsio, just ignore. rm -rf node_modules npm install

21reactions
k3ntar0commented, Mar 18, 2020

Summary of mentions as above (it doesn’t work for me at all)

  • $ rm -rf /Users/{username}/.npm/_libvips
  • $ brew install vips

You should try downgrade node to stable version

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

v13.10.1 -> v12.16.1

https://www.hostingadvice.com/how-to/update-node-js-latest-version/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fail to install gatsby starter because of sharp - Stack Overflow
16.0 solved the problem for me) using nvm(to manage different node versions). commands for nvm are: a) "nvm install 10.16.0" (to install node ......
Read more >
Sharp error mac m1 - nvh95 Handbook
When running command yarn to install dependencies for a Gatsby project on Mac M1, I encounter this error with sharp:
Read more >
sharp - npm
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images. Latest version: 0.31.3, ...
Read more >
Build error: Can't build node_modules/sharp - Support
12:54:39 PM: npm ERR! path /opt/build/repo/node_modules/sharp 12:54:39 PM: npm ERR! command failed 12:54:39 PM: npm ERR! command sh -c node-gyp rebuild
Read more >
一站式解决Node项目中遇到的诸如sharp Command failed.或 ...
error /mnt/e/One life projects/OneLifeAdmin/node_modules/favicons/node_modules/sharp: Command failed. Exit code: 1 Command: (node install/ ...
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