Open buggedcom opened 5 years ago
Have you tried this?
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
I just ran that and got a load of updates, but unfortunately the npm install it still fails with what looks like the same failure
pi@raspberrypi:~/projects/led $ mv node_modules/ node_modules_816/
pi@raspberrypi:~/projects/led $ nvm install 11.15.0
v11.15.0 is already installed.
Now using node v11.15.0 (npm v6.7.0)
pi@raspberrypi:~/projects/led $ npm install
> canvas@2.5.0 install /home/pi/projects/led/node_modules/canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.5.0/canvas-v2.5.0-node-v67-linux-glibc-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for canvas@2.5.0 and node@11.15.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/projects/led/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/backend/Backend.o
CXX(target) Release/obj.target/canvas/src/backend/ImageBackend.o
CXX(target) Release/obj.target/canvas/src/backend/PdfBackend.o
CXX(target) Release/obj.target/canvas/src/backend/SvgBackend.o
CXX(target) Release/obj.target/canvas/src/bmp/BMPParser.o
../src/bmp/BMPParser.cc: In member function 'void BMPParser::Parser::parse(uint8_t*, int, uint8_t*)':
../src/bmp/BMPParser.cc:193:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
E(ptr - data > imgdOffset, "image data overlaps with another structure");
~~~~~~~~~~~^~~
../src/bmp/BMPParser.cc:10:25: note: in definition of macro 'E'
#define E(cond, msg) if(cond) return setErr(msg)
^~~~
../src/bmp/BMPParser.cc:208:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
E(ptr - data + imgdSize > len, "not enough image data");
~~~~~~~~~~~~~~~~~~~~~~^~~
../src/bmp/BMPParser.cc:10:25: note: in definition of macro 'E'
#define E(cond, msg) if(cond) return setErr(msg)
^~~~
CXX(target) Release/obj.target/canvas/src/Backends.o
CXX(target) Release/obj.target/canvas/src/Canvas.o
CXX(target) Release/obj.target/canvas/src/CanvasGradient.o
CXX(target) Release/obj.target/canvas/src/CanvasPattern.o
CXX(target) Release/obj.target/canvas/src/CanvasRenderingContext2d.o
../src/CanvasRenderingContext2d.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE Context2d::DrawImage(Nan::NAN_METHOD_ARGS_TYPE)':
../src/CanvasRenderingContext2d.cc:1291:45: error: call of overloaded 'abs(double&)' is ambiguous
double current_scale_x = abs(transforms[1]);
^
In file included from /usr/include/c++/6/cstdlib:75:0,
from /usr/include/c++/6/ext/string_conversions.h:41,
from /usr/include/c++/6/bits/basic_string.h:5417,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/stdexcept:39,
from /usr/include/c++/6/array:39,
from /usr/include/c++/6/tuple:39,
from /usr/include/c++/6/functional:55,
from /usr/include/c++/6/memory:79,
from /home/pi/.node-gyp/11.15.0/include/node/v8.h:21,
from /home/pi/.node-gyp/11.15.0/include/node/node.h:63,
from ../../nan/nan.h:54,
from ../src/backend/Backend.h:6,
from ../src/Canvas.h:5,
from ../src/CanvasRenderingContext2d.h:6,
from ../src/CanvasRenderingContext2d.cc:3:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^~~
In file included from /usr/include/c++/6/ext/string_conversions.h:41:0,
from /usr/include/c++/6/bits/basic_string.h:5417,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/stdexcept:39,
from /usr/include/c++/6/array:39,
from /usr/include/c++/6/tuple:39,
from /usr/include/c++/6/functional:55,
from /usr/include/c++/6/memory:79,
from /home/pi/.node-gyp/11.15.0/include/node/v8.h:21,
from /home/pi/.node-gyp/11.15.0/include/node/node.h:63,
from ../../nan/nan.h:54,
from ../src/backend/Backend.h:6,
from ../src/Canvas.h:5,
from ../src/CanvasRenderingContext2d.h:6,
from ../src/CanvasRenderingContext2d.cc:3:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^~~
../src/CanvasRenderingContext2d.cc:1292:45: error: call of overloaded 'abs(double&)' is ambiguous
double current_scale_y = abs(transforms[2]);
^
In file included from /usr/include/c++/6/cstdlib:75:0,
from /usr/include/c++/6/ext/string_conversions.h:41,
from /usr/include/c++/6/bits/basic_string.h:5417,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/stdexcept:39,
from /usr/include/c++/6/array:39,
from /usr/include/c++/6/tuple:39,
from /usr/include/c++/6/functional:55,
from /usr/include/c++/6/memory:79,
from /home/pi/.node-gyp/11.15.0/include/node/v8.h:21,
from /home/pi/.node-gyp/11.15.0/include/node/node.h:63,
from ../../nan/nan.h:54,
from ../src/backend/Backend.h:6,
from ../src/Canvas.h:5,
from ../src/CanvasRenderingContext2d.h:6,
from ../src/CanvasRenderingContext2d.cc:3:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^~~
In file included from /usr/include/c++/6/ext/string_conversions.h:41:0,
from /usr/include/c++/6/bits/basic_string.h:5417,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/stdexcept:39,
from /usr/include/c++/6/array:39,
from /usr/include/c++/6/tuple:39,
from /usr/include/c++/6/functional:55,
from /usr/include/c++/6/memory:79,
from /home/pi/.node-gyp/11.15.0/include/node/v8.h:21,
from /home/pi/.node-gyp/11.15.0/include/node/node.h:63,
from ../../nan/nan.h:54,
from ../src/backend/Backend.h:6,
from ../src/Canvas.h:5,
from ../src/CanvasRenderingContext2d.h:6,
from ../src/CanvasRenderingContext2d.cc:3:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^~~
canvas.target.mk:138: recipe for target 'Release/obj.target/canvas/src/CanvasRenderingContext2d.o' failed
make: *** [Release/obj.target/canvas/src/CanvasRenderingContext2d.o] Error 1
make: Leaving directory '/home/pi/projects/led/node_modules/canvas/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/pi/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:193:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:255:12)
gyp ERR! System Linux 4.14.98-v7+
gyp ERR! command "/home/pi/.nvm/versions/node/v11.15.0/bin/node" "/home/pi/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/projects/led/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/pi/projects/led/node_modules/canvas/build/Release" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v67"
gyp ERR! cwd /home/pi/projects/led/node_modules/canvas
gyp ERR! node -v v11.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/home/pi/.nvm/versions/node/v11.15.0/bin/node /home/pi/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/projects/led/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/projects/led/node_modules/canvas/build/Release --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v67' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/pi/projects/led/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:193:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:999:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
node-pre-gyp ERR! System Linux 4.14.98-v7+
node-pre-gyp ERR! command "/home/pi/.nvm/versions/node/v11.15.0/bin/node" "/home/pi/projects/led/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/projects/led/node_modules/canvas
node-pre-gyp ERR! node -v v11.15.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/home/pi/.nvm/versions/node/v11.15.0/bin/node /home/pi/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/projects/led/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/projects/led/node_modules/canvas/build/Release --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v67' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.5.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.5.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-06-07T08_39_58_204Z-debug.log
The installation consistently fails to build Canvas, you mentioned that you managed to have it installed on
11.15.0
so I have tried it but it still fails for me.I realise this is probably an issue with
Canvas
and notrpi-matrix
but was wondering if you might now what is wrong?