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

[Bug]: error /app/node_modules/sharp: Command failed. #2560

Open
NewSNode opened this issue May 8, 2024 · 2 comments
Open

[Bug]: error /app/node_modules/sharp: Command failed. #2560

NewSNode opened this issue May 8, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@NewSNode
Copy link

NewSNode commented May 8, 2024

What happened?

when i exec docker compose up,same error comes, as log info.

what happened?

Relevant log output

=> ERROR [frontend deps 6/6] RUN     if [ -f yarn.lock ]; then yarn --frozen-lockfile;     elif [ -f pac  404.3s
------
 > [frontend deps 6/6] RUN     if [ -f yarn.lock ]; then yarn --frozen-lockfile;     elif [ -f package-lock.json ]; then npm ci;     elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile;     else echo "Lockfile not found." && exit 1;     fi:
0.674 yarn install v1.22.19
0.800 [1/4] Resolving packages...
1.417 [2/4] Fetching packages...
1.432 warning Pattern ["string-width@^4.1.0"] is trying to unpack in the same destination "/usr/local/share/.cache/yarn/v6/npm-string-width-cjs-4.2.3-integrity/node_modules/string-width-cjs" as pattern ["string-width-cjs@npm:string-width@^4.2.0"]. This could result in non-deterministic behavior, skipping.
362.9 warning chart.js@4.4.2: The engine "pnpm" appears to be invalid.
362.9 [3/4] Linking dependencies...
362.9 warning " > @testing-library/user-event@14.5.1" has unmet peer dependency "@testing-library/dom@>=7.21.4".
362.9 warning " > @typescript-eslint/eslint-plugin@5.62.0" has unmet peer dependency "@typescript-eslint/parser@^5.0.0".
363.0 warning " > @vitejs/plugin-react@4.0.4" has unmet peer dependency "vite@^4.2.0".
398.3 [4/4] Building fresh packages...
399.1 error /app/node_modules/sharp: Command failed.
399.1 Exit code: 1
399.1 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
399.1 Arguments:
399.1 Directory: /app/node_modules/sharp
399.1 Output:
399.1 sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-linuxmusl-x64.tar.br
399.1 sharp: Installation error: connect ECONNREFUSED 127.0.0.1:443
399.1 sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
399.1 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
failed to solve: process "/bin/sh -c if [ -f yarn.lock ]; then yarn --frozen-lockfile;     elif [ -f package-lock.json ]; then npm ci;     elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile;     else echo \"Lockfile not found.\" && exit 1;     fi" did not complete successfully: exit code: 1

Twitter / LinkedIn details

No response

@NewSNode NewSNode added the bug Something isn't working label May 8, 2024
Copy link

dosubot bot commented May 8, 2024

The error you're encountering with the sharp module during your Docker build is likely due to it failing to download the libvips library from GitHub's servers. This can happen because of network connectivity issues or a proxy blocking access to GitHub.

To work around this, you can specify an alternative URL for downloading libvips by setting the SHARP_DIST_BASE_URL environment variable in your Dockerfile. Here's an example of how to do it:

ENV SHARP_DIST_BASE_URL="https://your-alternative-url.com/"

Replace "https://your-alternative-url.com/" with the URL of your alternative source for libvips.

Additionally, since you're using an Alpine Linux base image, you might need to install the vips-dev package to resolve any issues related to compiling the native dependencies required by sharp. Add this line to your Dockerfile before installing Node.js dependencies:

RUN apk add --update --no-cache vips-dev

This ensures the necessary libraries for sharp are available, potentially resolving the installation issues. For more detailed information on system dependencies for sharp, refer to the sharp installation guide.

If you continue to face issues or have any more questions, feel free to ask.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@NewSNode
Copy link
Author

NewSNode commented May 8, 2024

I have added some info to Dockerfile of the frontend program, and i exce success.

the info as:

RUN apk add --update --no-cache vips-dev fftw-dev build-base

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant