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.

yarn failing because of sharp?

See original GitHub issue

I’m trying to get Pushpin running on a new system and I’m running into yarn failing:

➜  pushpin git:(master) yarn
yarn install v1.19.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > use-immer@0.3.3" has incorrect peer dependency "immer@^2.0.0 || ^3.0.0".
[4/4] 🔨  Building fresh packages...
[-/11] ⠁ waiting...
[-/11] ⠁ waiting...
[11/11] ⠁ better-sqlite3
[10/11] ⠁ sharp
error /Users/trobbins/dev/inkandswitch/pushpin/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: /Users/trobbins/dev/inkandswitch/pushpin/node_modules/sharp
Output:
info sharp Using cached /Users/trobbins/.npm/_libvips/libvips-8.8.1-darwin-x64.tar.gz
ERR! sharp Please delete /Users/trobbins/.npm/_libvips/libvips-8.8.1-darwin-x64.tar.gz as it is not a valid tarball
ERR! sharp zlib: unexpected end of file
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 info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@12.13.1 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/trobbins/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/trobbins/dev/inkandswitch/pushpin/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/trobbins/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/trobbins/Library/Caches/node-gyp/12.13.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/trobbins/Library/Caches/node-gyp/12.13.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/trobbins/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/trobbins/Library/Caches/node-gyp/12.13.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/trobbins/dev/inkandswitch/pushpin/node_modules/sharp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
../src/common.cc:25:10: fatal error: 'vips/vips8' file not found
#include <vips/vips8>
         ^~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/sharp/src/common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/trobbins/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.2.0
gyp ERR! command "/Users/trobbins/.nvm/versions/node/v12.13.1/bin/node" "/Users/trobbins/.nvm/versions/node/v12.13.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/trobbins/dev/inkandswitch/pushpin/node_modules/sharp

Is this a new issue or is my configuration wrong?

I’m running:

node 12.13.1 yarn 1.19.1

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
todrobbinscommented, Nov 21, 2019

I also had to clear out /Users/trobbins/.npm/_libvips/ and that did the trick! Cheers!

1reaction
pvhcommented, Nov 20, 2019

probably a node-gyp one. That library is the worrrrrst.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sharp: Command failed · Issue #585 · gridsome ... - GitHub
I'm running into the same errors. win7 64 node@10.16.1 npm@6.10.2 python@2.7.15. (not using yarn ). Same errors gongph is encountering.
Read more >
Fail to install gatsby starter because of sharp - Stack Overflow
The problem may be due to node v12.x and using npm instead of yarn which caused me issues. Steps to solve the issue....
Read more >
gatsby-plugin-sharp - npm
By default, builds will fail if sharp finds an image with corrupted pixel values. When setting failOn to none the image will return ......
Read more >
Something went wrong installing the "sharp" module (fix)
If you get the following or a similar sharp module related error when ... just because one project (in this case Gatsby) doesn't...
Read more >
Error in installing packages using yarn in windows 11 - GSoC
yarn install produced the following error: ➤ YN0000: ┌ Resolution step ... or the last one failed ➤ YN0007: │ sharp@npm:0.26.3 must be...
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