-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sharp errors when self-installing libvips #1725
Comments
It looks like there are multiple, conflicting versions of libvips installed. Perhaps brew didn't remove one or more versions properly. Try running all of the following commands, in this order, to ensure everything is update-to-date. brew uninstall vips
brew update
brew upgrade
brew cleanup Then |
Thank you for the help. Running those and re-installing Sharp doesn't fix it though, unfortunately. Is there some way to see exactly what version it's trying to use - like somewhere in the code I can put a logline and trace what it's finding globally? Also, if libvips installs locally into sharp's node_modules folder, why doesn't it only use that locally-installed version from that point? |
What is the output of running |
|
Thanks, that looks OK to me. Could there be two different versions of sharp in |
This works as expected:
I think I've discovered the issue, though. We build our server with webpack (so that we can share code and have identical transforms and etc. on the backend w/ the frontend). To prevent this from doing anything funky with node modules, we put all of our However, it looks like the You can feel free to close this if you'd like as it's related to our build pipeline, though if there's an easy way to fix this or throw an appropriate error it may be worth considering as well. Thanks for the help. (webpack aside, doing a |
That's great detective work, thank you for updating this issue with the details. The prebuilt binary tarballs contain and rely on symlinks. Was there a webpack setting you had to alter to fix its handling of them? |
@iEchoic yeah would be great if you could share some more information. Did you extend the webpack packaging, to copy over the libvips? |
@lovell @KillerCodeMonkey we have a step after the build now that runs essentially this:
There's an issue out for the popular copy-webpack-plugin that would allow us to resolve in a cleaner way, should it get implemented. |
I ran into this exact same error when upgrading from 0.21.2 -> 0.23.0. The problem for me was that I had a subproject with its own node_modules folder that also had a dependency on sharp (but a different version), and those differing versions interfered with each other. Once I got all the versions in alignment, the errors went away. |
My understanding is that sharp uses the global libvips when available, and installs its own when unavailable.
When I install libvips globally, everything works. However, I do not want to rely on global libvips - but when I then do
brew uninstall libvips
, and re-add sharp, everything builds correctly (and i can see libvips in the node_modules vendor folder) except sharp crashes crashes with the following error every time I try to call it in code:Because everything is working fine when I have global libvips, I think this must be a problem with the installation of libvips locally? Please let me know if there's any other info that would help debug this.
What is the output of running
npx envinfo --binaries --languages --system --utilities
?Are you able to provide a standalone code sample, without other dependencies, that demonstrates this problem?
This appears to be an issue with Sharp's installation process failing on specific environment or machine config. Any sharp operation fails, including simply instantiating sharp with a png and then calling
.png()
.The text was updated successfully, but these errors were encountered: