Comments (16)
I confirm the problem using node:18-alpine3.19
Running npm i
this is the problem shown:
npm ERR! code 1
npm ERR! path /usr/src/app/node_modules/sharp
npm ERR! command failed
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: Invalid Version: 1.2.4_git20230717
Downgrade to node:18-alpine3.18 it works.
from docker-node.
Had same issues with Sharp too, maybe some compilation libraries (libc, musl) are outdated or updated?
#0 61.63 npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] #0 61.63 npm ERR! ../src/pipeline.cc: In member function 'virtual void PipelineWorker::OnOK()': #0 61.63 npm ERR! ../src/pipeline.cc:1229:30: error: aggregate 'PipelineWorker::OnOK()::stat64 st' has incomplete type and cannot be defined #0 61.63 npm ERR! 1229 | struct STAT64_STRUCT st; #0 61.63 npm ERR! | ^~ #0 61.63 npm ERR! ../src/pipeline.cc:1230:55: error: invalid use of incomplete type 'struct PipelineWorker::OnOK()::stat64' #0 61.63 npm ERR! 1230 | if (STAT64_FUNCTION(baton->fileOut.data(), &st) == 0) { #0 61.63 npm ERR! | ^ #0 61.63 npm ERR! ../src/pipeline.cc:44:23: note: forward declaration of 'struct PipelineWorker::OnOK()::stat64' #0 61.63 npm ERR! 44 | #define STAT64_STRUCT stat64 #0 61.63 npm ERR! | ^~~~~~ #0 61.63 npm ERR! ../src/pipeline.cc:1229:16: note: in expansion of macro 'STAT64_STRUCT' #0 61.63 npm ERR! 1229 | struct STAT64_STRUCT st; #0 61.63 npm ERR! | ^~~~~~~~~~~~~ #0 61.63 npm ERR! make: *** [sharp-linuxmusl-x64.target.mk:167: Release/obj.target/sharp-linuxmusl-x64/src/pipeline.o] Error 1
Is there any version I can downgrade for now? I can't get the specific tag, but it seems to be this digest which was working for me:
4bdb3f3105718f0742bc8d64bb4e36e8f955ebbee295325e40ae80bc8ef78833
I downgraded to node:18-alpine3.18
and everything is work for now, I'll continue to follow this issue to upgrade when I can
from docker-node.
Ah, for some, this looks like a sharp module incompatibility with the newer libvips
of the Alpine packages. In Alpine 3.18, libvips
is 8.13.3
, but it is 8.15.0
in Alpine 3.19 (https://pkgs.alpinelinux.org/packages?name=vips-dev&branch=v3.19).
https://github.com/lovell/sharp/blob/v0.30.7/package.json#L157
https://github.com/lovell/sharp/blob/v0.31.3/package.json#L158
https://github.com/lovell/sharp/blob/v0.32.6/package.json#L162
https://github.com/lovell/sharp/blob/v0.33.0/package.json#L190
I think just updating your sharp dependency should be enough in some cases:
$ docker run --rm node:18-alpine3.19 npm install -g [email protected]
npm ERR! code 1
npm ERR! path /usr/local/lib/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: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: Invalid Version: 1.2.4_git20230717
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-12-13T19_14_03_677Z-debug-0.log
$ docker run --rm node:18-alpine3.19 npm install -g [email protected]
npm ERR! code 1
npm ERR! path /usr/local/lib/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: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: Invalid Version: 1.2.4_git20230717
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-12-13T19_14_11_327Z-debug-0.log
$ docker run --rm node:18-alpine3.19 npm install -g [email protected]
added 51 packages in 3s
$ docker run --rm node:18-alpine3.19 npm install -g [email protected]
added 15 packages in 2s
from docker-node.
@nschonni I tried following those instructions using node:20-alpine
, I had the same build error until I switched to node:20-alpine3.18
without those extra apt packages being installed.
from docker-node.
working on node:21-alpine3.18
from docker-node.
The Alpine image never supported node-gyp building without additional packages being added. Instructions can be found here https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#node-gyp-alpine
Likely the Sharp or other packages were shipping pre-built binaries that aren't currently compatible with the newest Alpine image, no change in this repo will fix that.
from docker-node.
Is it somehow missing python from the install?
from docker-node.
We had the latest node:18-alpine image (now pointing to node:18-alpine3.19 instead of node:18-alpine3.18) segfault and had to hardcode not to use the 18-alpine tag but specifically the alpine3.18 based one.
Maybe related?
from docker-node.
I can't be very specific publicly, but two of our use cases using the alpine3.19 based node:18 image always exited with exit code: 139
from docker-node.
Had same issues with Sharp too, maybe some compilation libraries (libc, musl) are outdated or updated?
#0 61.63 npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
#0 61.63 npm ERR! ../src/pipeline.cc: In member function 'virtual void PipelineWorker::OnOK()':
#0 61.63 npm ERR! ../src/pipeline.cc:1229:30: error: aggregate 'PipelineWorker::OnOK()::stat64 st' has incomplete type and cannot be defined
#0 61.63 npm ERR! 1229 | struct STAT64_STRUCT st;
#0 61.63 npm ERR! | ^~
#0 61.63 npm ERR! ../src/pipeline.cc:1230:55: error: invalid use of incomplete type 'struct PipelineWorker::OnOK()::stat64'
#0 61.63 npm ERR! 1230 | if (STAT64_FUNCTION(baton->fileOut.data(), &st) == 0) {
#0 61.63 npm ERR! | ^
#0 61.63 npm ERR! ../src/pipeline.cc:44:23: note: forward declaration of 'struct PipelineWorker::OnOK()::stat64'
#0 61.63 npm ERR! 44 | #define STAT64_STRUCT stat64
#0 61.63 npm ERR! | ^~~~~~
#0 61.63 npm ERR! ../src/pipeline.cc:1229:16: note: in expansion of macro 'STAT64_STRUCT'
#0 61.63 npm ERR! 1229 | struct STAT64_STRUCT st;
#0 61.63 npm ERR! | ^~~~~~~~~~~~~
#0 61.63 npm ERR! make: *** [sharp-linuxmusl-x64.target.mk:167: Release/obj.target/sharp-linuxmusl-x64/src/pipeline.o] Error 1
Is there any version I can downgrade for now? I can't get the specific tag, but it seems to be this digest which was working for me: 4bdb3f3105718f0742bc8d64bb4e36e8f955ebbee295325e40ae80bc8ef78833
from docker-node.
This is happening when node and sharp versions mismatch in my case. So I recommend trying to install both node and sharp latest versions. Either try downgrading both node and sharp versions as for your needs. In my case, node 16 and sharp 0.30.3 work fine. But sharp 0.30.3 doesn't work with node 20.
from docker-node.
Changing image from node:18-alpine
to node:18-alpine3.18
in my Dockerfile
worked for me.
from docker-node.
Why do I still get an error after changing it to node:18-alpine3.18?
from docker-node.
I am using image node:20-alpine3.18 from node:18-alpine works for me..
from docker-node.
It works for me also with node:18-alpine3.18. Hopefully, this will be fixed in the next releases.
from docker-node.
For me it worked by changing the alpine version to 3.18.
Dockerfile:
FROM node:18-alpine3.18 AS build
from docker-node.
Related Issues (20)
- Minor change in unofficial-builds workflow HOT 6
- 20.11.1-bullseye-slim: no matching manifest for linux/arm64/v8 in the manifest list entries
- 20.11.1-bullseye-slim: no matching manifest for linux/arm64/v8 in the manifest list entries HOT 1
- node:lts-alpine apk not found HOT 2
- Major bug was fixed in [email protected] concerning nodejs images. HOT 3
- node:lts-slim has vulnerability - CVE-2023-42282 - due to not updated npm ip package HOT 2
- `libc6-compat` not on alpine anymore? HOT 3
- Major bug was fixed in [email protected] concerning nodejs images. Node has new version with the fixed NPM. HOT 1
- Update Docker Images to support Alpine Edge release HOT 3
- npm on node:20.11-alpine3.18 fails with "Someone might have tampered with these packages since they were published on the registry!" HOT 3
- Major bug was fixed in [email protected] concerning nodejs images. HOT 1
- [NEXT-SECURITY-RELEASE] Heads up on upcoming Node.js security release 2024/04/03 HOT 4
- Force update the image certificates bundle during build HOT 1
- [NEXT-SECURITY-RELEASE] Heads up on upcoming Node.js security release 2024/04/09 HOT 2
- Images for Windows HOT 1
- Update yarn version to 1.22.22 HOT 7
- CVE-2024-28863 HOT 1
- Clarify support policy (for Alpine)? HOT 1
- v22.0.0 `arm` image broken HOT 6
- Docker build stucks on FROM --platform=linux/amd64 node:current-alpine image HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-node.