Skip to content
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 <0.33 installation issues #202

Closed
Kemystra opened this issue Jan 1, 2024 · 5 comments
Closed

sharp <0.33 installation issues #202

Kemystra opened this issue Jan 1, 2024 · 5 comments

Comments

@Kemystra
Copy link

Kemystra commented Jan 1, 2024

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

@Kemystra
Copy link
Author

Kemystra commented Jan 1, 2024

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.

@MickL
Copy link

MickL commented Jan 4, 2024

@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

@Kemystra
Copy link
Author

Kemystra commented Jan 4, 2024

@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.

@MickL
Copy link

MickL commented Jan 4, 2024

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 ?

@pi0 pi0 changed the title Old version of sharp causes installation error sharp <0.33 installation issues Jan 12, 2024
@pi0
Copy link
Member

pi0 commented Jan 12, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants