Coder Social home page Coder Social logo

Comments (13)

JaydenWooCn avatar JaydenWooCn commented on August 26, 2024 1

Change the ipx to the latest version in @nuxt/image package.json solve my problem. Thank you very much lovell! I can't solve it without your help!

from sharp.

lovell avatar lovell commented on August 26, 2024

Please upgrade to the latest version of ipx and therefore the latest version of sharp.

For Termux, you'll also need to configure npm to ensure it knows the OS is Linux using the npm install --os=linux flag.

https://sharp.pixelplumbing.com/install#cross-platform

from sharp.

JaydenWooCn avatar JaydenWooCn commented on August 26, 2024

when I run npm install --os=linux sharp, encountered error as below:

Package xproto was not found in the pkg-config search path.
Perhaps you should add the directory containing `xproto.pc' to the PKG_CONFIG_PATH environment variable Package 'xproto', required by 'xrender', not found gyp: Undefined variable android_ndk_path in binding.gyp while trying to load binding.gyp

I afraid Termux does not directly support X11 libraries and related packages like xproto.

please further help!

from sharp.

ahtashamabbasse avatar ahtashamabbasse commented on August 26, 2024

Hi,

I'm experiencing the same issue with the Sharp library. I'm developing on a MacBook M1 and trying to use Sharp for image manipulation. When attempting to deploy it on AWS Lambda, I encountered problems. I added the following to my package.json:

"postinstall": "yarn add sharp --ignore-engines"

However, this results in an endless loop during installation. I've tried other solutions, but none have worked.

I then moved my deployment to Heroku but faced similar issues. I have limited access to specify the environment, and I don't have the necessary permissions to install Sharp via the shell.

FYI: I'm inclined to go with AWS Lambda.

Any assistance or guidance would be greatly appreciated.

Thank you!

from sharp.

lovell avatar lovell commented on August 26, 2024

@ahtashamabbasse This issue relates to Termux. If you're still having problems, please open a new installation issue and answer all of the questions.

from sharp.

lovell avatar lovell commented on August 26, 2024

@JaydenWooCn Please can you provide the complete output of running the following in an empty directory.

npm install --os=linux --verbose --foreground-scripts sharp

from sharp.

JaydenWooCn avatar JaydenWooCn commented on August 26, 2024

Thank you for your help, it seems that it work. so waht should I do next step?

npm install --os=linux --verbose --foreground-scripts sharp
npm verbose cli /data/data/com.termux/files/usr/bin/node /data/data/com.termux/files/usr/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verbose title npm install sharp
npm verbose argv "install" "--os" "linux" "--loglevel" "verbose" "--foreground-scripts" "sharp"
npm verbose logfile logs-max:10 dir:/data/data/com.termux/files/home/.npm/_logs/2024-07-16T12_05_00_103Z-
npm verbose logfile /data/data/com.termux/files/home/.npm/_logs/2024-07-16T12_05_00_103Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/sharp 507ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/semver 308ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/color 349ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/detect-libc 434ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-darwin-x64 180ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-darwin-x64 208ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm 184ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-darwin-arm64 402ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-s390x 132ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-x64 140ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linuxmusl-x64 157ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-arm 140ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-arm64 206ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-darwin-arm64 1509ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-s390x 144ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-x64 172ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linuxmusl-arm64 152ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linuxmusl-x64 145ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-wasm32 123ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm64 1314ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-win32-x64 140ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linuxmusl-arm64 1316ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-win32-ia32 1281ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/color-convert 104ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/color-string 135ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@emnapi%2fruntime 142ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/tslib 97ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 86ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/color-name 100ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/color-name 144ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 90ms (cache revalidated)
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-win32-x64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-win32-ia32
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-wasm32
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@emnapi/runtime
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/tslib
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-linuxmusl-x64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-linuxmusl-arm64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-linux-x64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-linux-s390x
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-linux-arm64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-linux-arm
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-libvips-linuxmusl-x64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-libvips-linuxmusl-arm64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-libvips-linux-x64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-libvips-linux-s390x
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-libvips-linux-arm64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-libvips-linux-arm
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-libvips-darwin-x64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-libvips-darwin-arm64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-darwin-x64
npm verbose reify failed optional dependency /data/data/com.termux/files/home/projects/demo/node_modules/@img/sharp-darwin-arm64
npm info run [email protected] install node_modules/sharp node install/check

[email protected] install
node install/check

sharp: Detected globally-installed libvips v8.15.2
sharp: Attempting to build from source via node-gyp
sharp: Please add node-addon-api to your dependencies
npm info run [email protected] install { code: 0, signal: null }

added 9 packages in 7s

1 package is looking for funding
run npm fund for details
npm verbose cwd /data/data/com.termux/files/home/projects/demo
npm verbose os Linux 5.10.177-android12-9-00001-g219d8dfbba07-ab10551810
npm verbose node v22.4.1
npm verbose npm v10.8.1
npm verbose exit 0
npm info ok

from sharp.

JaydenWooCn avatar JaydenWooCn commented on August 26, 2024

@lovell I have you show you the script output, please check. could you give me further help? any suggestion? Thank you!

from sharp.

lovell avatar lovell commented on August 26, 2024

In your first comment you provided an error seen when installing a version of sharp that is not the latest. From your most recent comment it looks like installing the latest version works.

It looks like you're using sharp through the ipx dependency, so therefore please upgrade to the latest version of ipx and therefore the latest version of sharp.

from sharp.

JaydenWooCn avatar JaydenWooCn commented on August 26, 2024

This is a nuxtjs project, have a @nuxt/image component there.
I have check there are exist ipx3.0.1(latest) and sharp0.33.4(latest) in the node_modules folder.
When I run npm install --os=linux, the output as below:


[email protected] install
(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-android-arm64v8.tar.br
sharp: Installation error: Prebuilt libvips 8.14.5 binaries are not yet available for android-arm64v8
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies

postinstall
nuxt prepare

✔ Types generated in .nuxt 3:45:26 PM

added 5 packages, and audited 685 packages in 20s

138 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

I think some package dependence on [email protected], so it want to install that version, but I don't sknow which package dependence on it. So could you give me any suggesion?

from sharp.

JaydenWooCn avatar JaydenWooCn commented on August 26, 2024

Even when I run this script npm install --os=linux --save [email protected] specific exact
the latest version, it still try to install the older version 0.32.6, this is the output:

npm install --os=linux --save [email protected]

[email protected] install
node install/check

[email protected] install
(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-android-arm64v8.tar.br
sharp: Installation error: Prebuilt libvips 8.14.5 binaries are not yet available for android-arm64v8
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies

[email protected] install
(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-android-arm64v8.tar.br
sharp: Installation error: Prebuilt libvips 8.14.5 binaries are not yet available for android-arm64v8
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm error code 1
npm error path /data/data/com.termux/files/home/projects/greenroom/greenroom/node_modules/ipx/node_modules/sharp
npm error command failed
npm error command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm error A complete log of this run can be found in: /data/data/com.termux/files/home/.npm/_logs/2024-07-19T02_46_50_242Z-debug-0.log

from sharp.

lovell avatar lovell commented on August 26, 2024

What is the output of running npm ls sharp in the /data/data/com.termux/files/home/projects/greenroom/greenroom directory?

from sharp.

JaydenWooCn avatar JaydenWooCn commented on August 26, 2024

@lovell This the output, please check.

npm ls sharp
nuxt-app@ /data/data/com.termux/files/home/projects/greenroom/greenroom
├─┬ [email protected] invalid: "^2.1.0" from node_modules/@nuxt/image
│ └── [email protected] deduped
└── [email protected]

So I need to set the ipx version to ipx3.0.1(latest), right? I have a try right now

from sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.