sharp <0.33 installation issues
Closed this issue · 5 comments
Environment
Node: v21.5.0
npm: 10.2.5
Reproduction
This issue isn't related to ipx
itself, but rather to its sharp
dependency.
Describe the bug
ipx
currently depends on ^sharp@0.32.0
. This sharp
version (and other 0.32.x
versions) utilizes a problematic custom install script that may fail on some machines (see lovell/sharp#3833 and lovell/sharp#3750). Any sharp
versions upwards of 0.33.0
would have fixed this problem.
For reference, this is one of the errors that may happen during installation:
npm ERR! code 1
npm ERR! path /home/user/.local/lib/node_modules/ipx/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-
gyp rebuild && node install/dll-copy)
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-linux-x64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: Request timed out
Additional context
No response
Logs
No response
Right, I didn't notice that pull request (#190). Sorry for that.
Nevertheless, I think I will keep this issue open so that people that encounter this same problem will understand why.
For those who came here because of the above error: TL;DR, one of ipx
dependencies is too old and uses a weird install script. There is a pull request addressing this problem, though. For now, you can use the npm:ipx-nightly@latest
version to avoid this problem.
@Kemystra Has the PR been released to npm? I am on latest ipx 2.0.2
and the sharp dependency is ^0.32.6
.
I come here because using Bun sharp is not getting installed. This has been fixed with 0.33.0
of sharp, latest version is 0.33.1
: lovell/sharp#3511
The problem is cascading a bit because @nuxt/image
is using ipx ^2.0.2
which is using sharp ^0.32.6
@MickL as of just now, no the PR (#190) is still in draft state (and npm
installation is still failing). Also seems like Bun installed ipx@latest
and sharp@0.33.0
just fine, so that's nice. Bun really does handle the script properly.
And yeah, this problem is cascading. I came here in the first place from netlify/cli cuz I can't install that too.
Yes it works fine in Bun with latest sharp 0.33.1
. When using @nuxt/image
just run bun add sharp
which will add 0.33.1
and everything works.
Problem is that sharp is still in 0.x
which means ^0.x
will not grab any minor update, I think even ^0.33.0
will not grab 0.33.1
Hope sharp version will be updated soon in unjs/ipx
. Can we just set the version in package.json to ^0.33.1
@pi0 ?
https://github.com/unjs/ipx/releases/tag/v3.0.0
(due to potential breaking changes, it is released as a major version in IPX same as sharp)