fatal error: jpeglib.h: No such file or directory # Ubuntu
edouard-lopez opened this issue · comments
Installing on Linux Mint 17.2 Rafaela
gives:
npm install csscritic
npm WARN package.json projetslabo@ No description
npm WARN package.json projetslabo@ No repository field.
npm WARN package.json projetslabo@ No README data
npm WARN package.json projetslabo@ No license field.
npm WARN deprecated jssha@1.5.0: jsSHA versions < v2.0.0 will no longer receive features
> canvas@1.1.6 install /home/elopez/projects/ynov-projets-labo/frontend/node_modules/csscritic/node_modules/imagediff/node_modules/canvas
> node-gyp rebuild
make: Entering directory `/home/elopez/projects/ynov-projets-labo/frontend/node_modules/csscritic/node_modules/imagediff/node_modules/canvas/build'
SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
COPY Release/canvas-postbuild.node
CXX(target) Release/obj.target/canvas/src/Canvas.o
In file included from ../src/Canvas.cc:19:0:
../src/JPEGStream.h:10:21: fatal error: jpeglib.h: No such file or directory
#include <jpeglib.h>
^
compilation terminated.
make: *** [Release/obj.target/canvas/src/Canvas.o] Error 1
make: Leaving directory `/home/elopez/projects/ynov-projets-labo/frontend/node_modules/csscritic/node_modules/imagediff/node_modules/canvas/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.16.0-38-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/elopez/projects/ynov-projets-labo/frontend/node_modules/csscritic/node_modules/imagediff/node_modules/canvas
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing canvas@1.1.6
Solved by installing:
sudo apt-get install libjpeg-dev
Hi thanks for the report.
Can you tell me whether npm actually failed downloading csscritic and putting it into node_modules?
Technically canvas is not necessary, but rather marked as optional. While npm tries to download canvas it will encounter the issues you've documented, but is expected to skip and finish up with errorlevel 1.
The line in question is https://github.com/HumbleSoftware/js-imagediff/blob/master/package.json#L23, using https://docs.npmjs.com/files/package.json#optionaldependencies.
I agree that this is hugely irritating, and welcoming new users with an error message is bad, but I currently don't see a better solution.
Thanks a lot!