Hi All,
I have a problem with running node-red-node-serialport what is using node_serialport on a rpi based device.
On building the docker img i get errors like:
[34m[main]e[39m Step 7/9 : RUN apk add --no-cache make gcc g++ python && JOBS=MAX npm install -g node-red-node-serialport --production --silent --unsafe-perm && JOBS=MAX npm install -g node-red-contrib-modbus --production --silent --unsafe-perm && apk del make gcc g++ python && npm cache clean --force && rm -rf /tmp/*
e[34m[main]e[39m ---> Running in 727dbe264537
e[34m[main]e[39m fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/armhf/APKINDEX.tar.gz
e[34m[main]e[39m fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/armhf/APKINDEX.tar.gz
e[34m[main]e[39m (1/13) Installing binutils (2.30-r5)
e[34m[main]e[39m (2/13) Installing isl (0.18-r0)
e[34m[main]e[39m (3/13) Installing libgomp (6.4.0-r8)
e[34m[main]e[39m (4/13) Installing libatomic (6.4.0-r8)
e[34m[main]e[39m (5/13) Installing mpfr3 (3.1.5-r1)
e[34m[main]e[39m (6/13) Installing mpc1 (1.0.3-r1)
e[34m[main]e[39m (7/13) Installing gcc (6.4.0-r8)
e[34m[main]e[39m (8/13) Installing musl-dev (1.1.19-r10)
e[34m[main]e[39m (9/13) Installing libc-dev (0.7.1-r0)
e[34m[main]e[39m (10/13) Installing g++ (6.4.0-r8)
e[34m[main]e[39m (11/13) Installing make (4.2.1-r2)
e[34m[main]e[39m (12/13) Installing gdbm (1.13-r1)
e[34m[main]e[39m (13/13) Installing python2 (2.7.15-r0)
e[34m[main]e[39m Executing busybox-1.28.4-r0.trigger
e[34m[main]e[39m OK: 205 MiB in 83 packages
e[34m[main]e[39m make: Entering directory '/usr/local/lib/node_modules/node-red-node-serialport/node_modules/serialport/build'
e[34m[main]e[39m CXX(target) Release/obj.target/serialport/src/serialport.o
e[34m[main]e[39m CXX(target) Release/obj.target/serialport/src/serialport_unix.o
e[34m[main]e[39m CXX(target) Release/obj.target/serialport/src/poller.o
e[34m[main]e[39m CXX(target) Release/obj.target/serialport/src/serialport_linux.o
e[34m[main]e[39m e[91m../src/serialport_linux.cpp:4:24: fatal error: asm/ioctls.h: No such file or directory
e[34m[main]e[39m #include <asm/ioctls.h>
e[34m[main]e[39m ^
e[34m[main]e[39m compilation terminated.
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91mmake: *** [serialport.target.mk:96: Release/obj.target/serialport/src/serialport_linux.o] Error 1
e[34m[main]e[39m make: *** Waiting for unfinished jobs....
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport_unix.cpp:24:26: fatal error: linux/serial.h: No such file or directory
e[34m[main]e[39m #include <linux/serial.h>
e[34m[main]e[39m ^
e[34m[main]e[39m compilation terminated.
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91mmake: *** [serialport.target.mk:96: Release/obj.target/serialport/src/serialport_unix.o] Error 1
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport.cpp: In function 'void EIO_AfterOpen(uv_work_t*)':
e[34m[main]e[39m ../src/serialport.cpp:95:30: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m data->callback.Call(2, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/./serialport.h:6:0,
e[34m[main]e[39m from ../src/serialport.cpp:1:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport.cpp: In function 'void EIO_AfterUpdate(uv_work_t*)':
e[34m[main]e[39m ../src/serialport.cpp:150:30: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m data->callback.Call(1, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/./serialport.h:6:0,
e[34m[main]e[39m from ../src/serialport.cpp:1:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/poller.cpp: In static member function 'static void Poller::onData(uv_poll_t*, int, int)':
e[34m[main]e[39m ../src/poller.cpp:69:29: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m obj->callback.Call(2, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/poller.cpp:1:0:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport.cpp: In function 'void EIO_AfterClose(uv_work_t*)':
e[34m[main]e[39m ../src/serialport.cpp:188:30: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m data->callback.Call(1, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/./serialport.h:6:0,
e[34m[main]e[39m from ../src/serialport.cpp:1:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport.cpp: In function 'void EIO_AfterFlush(uv_work_t*)':
e[34m[main]e[39m ../src/serialport.cpp:231:30: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m data->callback.Call(1, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/./serialport.h:6:0,
e[34m[main]e[39m from ../src/serialport.cpp:1:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport.cpp: In function 'void EIO_AfterSet(uv_work_t*)':
e[34m[main]e[39m ../src/serialport.cpp:285:30: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m data->callback.Call(1, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/./serialport.h:6:0,
e[34m[main]e[39m from ../src/serialport.cpp:1:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport.cpp: In function 'void EIO_AfterGet(uv_work_t*)':
e[34m[main]e[39m ../src/serialport.cpp:336:30: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m data->callback.Call(2, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/./serialport.h:6:0,
e[34m[main]e[39m from ../src/serialport.cpp:1:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport.cpp: In function 'void EIO_AfterGetBaudRate(uv_work_t*)':
e[34m[main]e[39m ../src/serialport.cpp:383:30: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m data->callback.Call(2, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/./serialport.h:6:0,
e[34m[main]e[39m from ../src/serialport.cpp:1:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m e[91m../src/serialport.cpp: In function 'void EIO_AfterDrain(uv_work_t*)':
e[34m[main]e[39m ../src/serialport.cpp:424:30: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
e[34m[main]e[39m data->callback.Call(1, argv);
e[34m[main]e[39m ^
e[34m[main]e[39m In file included from ../src/./serialport.h:6:0,
e[34m[main]e[39m from ../src/serialport.cpp:1:
e[34m[main]e[39m ../../nan/nan.h:1618:3: note: declared here
e[34m[main]e[39m Call(int argc, v8::Local<v8::Value> argv[]) const {
e[34m[main]e[39m ^~~~
e[34m[main]e[39m e[0m
e[34m[main]e[39m make: Leaving directory '/usr/local/lib/node_modules/node-red-node-serialport/node_modules/serialport/build'
e[34m[main]e[39m Removing intermediate container 727dbe264537
e[34m[main]e[39m e[31mThe command '/bin/sh -c apk add --no-cache make gcc g++ python && JOBS=MAX npm install -g node-red-node-serialport --production --silent --unsafe-perm && JOBS=MAX npm install -g node-red-contrib-modbus --production --silent --unsafe-perm && apk del make gcc g++ python && npm cache clean --force && rm -rf /tmp/*' returned a non-zero code: 1e[39m
e[36m[Info]e[39m Uploading images
[================> ] 33%e[2Ke[Ge[32m[Success]e[39m Successfully uploaded images
e[31m[Error]e[39m Some services failed to build:
e[31m[Error]e[39m Service: main
e[31m[Error]e[39m Error: The command '/bin/sh -c apk add --no-cache make gcc g++ python && JOBS=MAX npm install -g node-red-node-serialport --production --silent --unsafe-perm && JOBS=MAX npm install -g node-red-contrib-modbus --production --silent --unsafe-perm && apk del make gcc g++ python && npm cache clean --force && rm -rf /tmp/*' returned a non-zero code: 1
e[31m[Error]e[39m Not deploying release.
I am using base img:
FROM resin/%%RESIN_MACHINE_NAME%%-alpine-node:9-slim
Is that running an old Nodejs version maybe? Does anyone know how to check this or how i can try to update the nodejs version?