Segmentation Fault on Ubuntu
reabreu opened this issue · comments
Hi, having an interesting error when trying to build (and executing) a Docker image with this library, during the yarn install step.
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linuxmusl-x64.tar.gz
Segmentation fault (core dumped)
make: Entering directory '/usr/src/app/common/node_modules/sharp/build'
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
CXX(target) Release/obj.target/sharp/src/metadata.o
CXX(target) Release/obj.target/sharp/src/stats.o
CXX(target) Release/obj.target/sharp/src/operations.o
CXX(target) Release/obj.target/sharp/src/pipeline.o
CXX(target) Release/obj.target/sharp/src/sharp.o
CXX(target) Release/obj.target/sharp/src/utilities.o
SOLINK_MODULE(target) Release/obj.target/sharp.node
COPY Release/sharp.node
make: Leaving directory '/usr/src/app/common/node_modules/sharp/build'
This error happens on Ubuntu 20.04.1 LTS. The same Docker container when run on Debian works fine. Do you have insight on why this could be happening?
Using node:10.18-alpine
Thanks for your help!
The appearance of linuxmusl
suggests you're running npm install
on a musl-based Linux such as Alpine. Alternatively, you've configured npm
to use a libc
value of "musl", which is incorrect for glibc-based Linux such as Ubuntu/Debian.
https://sharp.pixelplumbing.com/install#common-problems
The architecture and platform of Node.js used for npm install must be the same as the architecture and platform of Node.js used at runtime.