Node canvas is a Cairo backed Canvas implementation for NodeJS.
10.17k
stars
1.17k
forks
source link
Webpack node-loader - Error: libgif.so.7: No such file or directory / Error: /lib/x86_64-linux-gnu/libjpeg.so.62: version `LIBJPEGTURBO_6.2' not found #1723
Attempting to locally build and run my project with Webpack results in the error:
(node:8833) UnhandledPromiseRejectionWarning: Error: node-loader:
Error: /lib/x86_64-linux-gnu/libjpeg.so.62: version `LIBJPEGTURBO_6.2' not found (required by /home/mysterise/projects/mystbot/dist/1ac5511a17d7ad694cfe905612b1d208.node)
Attempting the same build, but in a node:10 base docker image results in a similar but slightly different error:
(node:72) UnhandledPromiseRejectionWarning: Error: node-loader:
Error: libgif.so.7: cannot open shared object file: No such file or directory
This is with the following relevant Webpack configuration for loading the Canvas dependencies:
@tonytangio uninstall the libjpeg62 and install libjpeg62-turbo_2.0.6-4_amd64.deb.
Also, it might ask you to recompile against correct NODE_MODULE_VERSION.
Issue
Using Node v10.23.0 with TypeScript and Webpack.
Attempting to locally build and run my project with Webpack results in the error:
Attempting the same build, but in a node:10 base docker image results in a similar but slightly different error:
This is with the following relevant Webpack configuration for loading the Canvas dependencies:
Additional Information
Running the project source directly with
ts-node
(development) rather than building with Webpack (production) does not have this issue.Canvas is installed normally without
--build-from-source
.libjpeg62
is installed and up to date.Your Environment
npm list canvas
oryarn list canvas
): canvas@2.6.1