gridsome: sharp: Command failed
Description
env
- win7 64
- node@10.15.x
- npm@6.4.1
- yarn@1.15.1
- python@3.7.x
Steps to reproduce
- 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...
...
- cd my-gridsome-site
- 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?
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 15
- Comments: 68 (5 by maintainers)
So after some digging/searching and trying these steps solved it for me:
rm -rf /Users/{username}/.npm/_libvipsbrew install vips// If this command throws some error about could not download cfitsio, just ignore.rm -rf node_modulesnpm installSummary of mentions as above (it doesn’t work for me at all)
$ rm -rf /Users/{username}/.npm/_libvips$ brew install vipsYou should try downgrade node to stable version
https://www.hostingadvice.com/how-to/update-node-js-latest-version/
OK, I’m having luck with
npm rebuildthen re-runningnpm install. I feel like I’ve done exactly that a couple of times, but this last time, it seemed to take. Oh, and I also downgraded my Node to v10.16.0 and NPM is v6.9.0, that seems to be getting me through.I tried, but it still didn’t work.
I’m having the same issue now after trying to reinstall. Could it be a sharp issue?
Is there no other solution than downgrading to a (much) older version of Node?
Same error after upgrade !! OS: ArchLinux
Resolved by :
@alainib Version 10.16 of nodejs does not give any errors. It would be better to switch to this version when using gridsome.
There is an tool : NVM(Node Version Manager) that allows to easily switch from one version of nodejs to another per project.
Downgrading to node 10.16.0 via NVM did the trick for me
I literally tried all the answers, regardless of breaking my repository and it doesn’t work
Until it occurred to me to downgrade Nodejs
v15.7.0to Nodev12.6.0and it worked perfectlyHaving same issues. Doesnt matter if i use the CLI or install from inside the dir.
OSX 10.14.5 Node v12.6 or v10.16.0 NPM 6.9.0. Yarn 1.17.3
Running npm rebuild didn’t help either.
Fails on
sharp@0.22.1 install, fatal error: ‘vips/vips8’ file not foundFor me downgrading node from 16.x to 14.x solved the issue.
It looks Gridsome is pretty much dead @shershen08 I would not bet on anything getting fixed anymore
For some people it worked to downgrading to node 14 instead of 10 but I’m still struggling to get this worked on M1 chip
nvm use 10npm ciprofit
After trying everything, nothing worked for me, finally just changed the node version to 10.16 and it works!
It may be relevant that the
brew install vipscommand never seems to resolve for me. It always either fails to start, or hangs somewhere. It never gives me a success message (or an error, for that matter; it just goes silent as though it’s stuck running forever).It doesn’t work for me OSX 10.15.1 Node v13.0.1 NPM 6.12.1 Yarn 1.19.2
I think the above sums up this thread pretty accurately. I tried many workarounds, including downgrading Node to v14 and such, but those were not future-proof enough and produced other random problems.
I ended up replacing Gridsome with Vue 3 and Vite, and to anyone who can take the liberty of doing that just like I could, I recommend you do the same.
any fix please ?
Can we remove the dependence on sharp and libvips? vips is a hefty dependency to carry, in that on Linux this dependency is so big it’s a nightmare (and often doesn’t work because libvips is a nightmare source to begin with) and I’m not a big fan of having to install a thousand dependencies that I’ll never use.
@u12206050 , this seems to be a solution if you’re on a Mac.
Any solution for Windows? I’m getting the same “python” error (made a thread here) that another guy up top was getting. I’ve had this project for almost two years and suddenly when trying to run the project last week, I get the Python error.
I haven’t been able to start this project since.
The thing that finally worked for me was to install sharp myself. Doesn’t feel like a great workaround, and
yarnstill spits out a ton of deprecation warnings when I run it, but at least my site is back accessible again after several hours.