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

Installing Sharp on node16-alpine image #3165

Closed
simplenotezy opened this issue Mar 29, 2022 · 1 comment
Closed

Installing Sharp on node16-alpine image #3165

simplenotezy opened this issue Mar 29, 2022 · 1 comment
Labels

Comments

@simplenotezy
Copy link

simplenotezy commented Mar 29, 2022

What are you trying to achieve?

I am trying to get Sharp working on a node16-alpine image.

I found this: #1379 - which says it should be very easy, but the link provided links to a 404.

Is there an example dockerfile for alpine we could see?

When you searched for similar issues, what did you find that might be related?

Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question

If I am simply trying to use the 16-alpine (or the 16-bullseye-slim as some mention) image, without installing any other dependencies/packages, it gives me the following error:

    nestjs-api-dev     | /usr/src/app/node_modules/sharp/lib/sharp.js:30
    nestjs-api-dev     |   throw new Error(help.join('\n'));
    nestjs-api-dev     |         ^
    nestjs-api-dev     | Error:
    nestjs-api-dev     | Something went wrong installing the "sharp" module
    nestjs-api-dev     |
    nestjs-api-dev     | Cannot find module '../build/Release/sharp-linuxmusl-x64.node'
    nestjs-api-dev     | Require stack:
    nestjs-api-dev     | - /usr/src/app/node_modules/sharp/lib/sharp.js
    nestjs-api-dev     | - /usr/src/app/node_modules/sharp/lib/constructor.js
    nestjs-api-dev     | - /usr/src/app/node_modules/sharp/lib/index.js
    nestjs-api-dev     | - /usr/src/app/dist/storage/service/storage.service.gcs.js
    nestjs-api-dev     | - /usr/src/app/dist/storage/service/storage.module.js
    nestjs-api-dev     | - /usr/src/app/dist/dating-profile/api/dating-profile.api.module.js
    nestjs-api-dev     | - /usr/src/app/dist/app.module.js
    nestjs-api-dev     | - /usr/src/app/dist/main.js
    nestjs-api-dev     |
    nestjs-api-dev     | Possible solutions:
    nestjs-api-dev     | - Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
    nestjs-api-dev     | - Install for the current runtime: "npm install --platform=linux --arch=x64 sharp"
    nestjs-api-dev     | - Consult the installation documentation: https://sharp.pixelplumbing.com/install
    nestjs-api-dev     |     at Object.<anonymous> (/usr/src/app/node_modules/sharp/lib/sharp.js:30:9)
    nestjs-api-dev     |     at Module._compile (node:internal/modules/cjs/loader:1103:14)
    nestjs-api-dev     |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    nestjs-api-dev     |     at Module.load (node:internal/modules/cjs/loader:981:32)
    nestjs-api-dev     |     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    nestjs-api-dev     |     at Module.require (node:internal/modules/cjs/loader:1005:19)
    nestjs-api-dev     |     at require (node:internal/modules/cjs/helpers:102:18)
    nestjs-api-dev     |     at Object.<anonymous> (/usr/src/app/node_modules/sharp/lib/constructor.js:8:1)
    nestjs-api-dev     |     at Module._compile (node:internal/modules/cjs/loader:1103:14)
    nestjs-api-dev     |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)

I notice it's trying to look for ../build/Release/sharp-linux-arm64v8.node however, the only release file that's inside that folder is: sharp-linuxmusl-arm64v8.node

Please provide sample image(s) that help explain this question

image

@lovell
Copy link
Owner

lovell commented Mar 29, 2022

Please open a new installation issue and answer all of the questions if you still require help.

@lovell lovell closed this as completed Mar 29, 2022
Repository owner locked and limited conversation to collaborators Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants