WiringPi / WiringPi-Node

Node.js bindings to wiringPi
333 stars 94 forks source link

Problem building wiring-pi on raspbian #58

Closed neojski closed 7 years ago

neojski commented 7 years ago

I was trying to build it on my raspberry pi but it failed [1]. I thought this might have been due to old node version so I upgraded it to v6.8.1 and npm to 3.10.8 but it didn't help.

Also, it sounds like npm install shouldn't succeed in this case.

[1] compilation log:

(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:7287) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

> wiring-pi@2.2.0 install /home/pi/node_modules/wiring-pi
> /bin/bash ./install.sh

Cloning libWiringPi ... done.
patching file ./wiringpi/devLib/Makefile
Hunk #1 succeeded at 24 with fuzz 1 (offset -2 lines).
Hunk #2 succeeded at 32 with fuzz 2 (offset -2 lines).
patching file ./wiringpi/gpio/Makefile
Making libWiringPi ... done.
Making devLib ...done.
Unistalling gpio utility ... done.
Making gpio utility ... done.
Installing gpio utility ... done.
Making wiring-pi ... (node:7721) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
make: Entering directory '/home/pi/node_modules/wiring-pi/build'
  CXX(target) Release/obj.target/wiringPi/src/addon.o
In file included from ../src/addon.h:4:0,
                 from ../src/addon.cc:1:
/home/pi/.node-gyp/6.8.1/include/node/v8.h:345:1: error: expected unqualified-id before ‘using’
/home/pi/.node-gyp/6.8.1/include/node/v8.h:481:1: error: expected unqualified-id before ‘using’
/home/pi/.node-gyp/6.8.1/include/node/v8.h:882:1: error: expected unqualified-id before ‘using’
/home/pi/.node-gyp/6.8.1/include/node/v8.h:5431:35: error: ‘virtual v8::EmbedderHeapTracer::~EmbedderHeapTracer()’ declared virtual cannot be defaulted in the class body
In file included from ../src/addon.cc:1:0:
../src/addon.h:12:24: error: ‘Handle’ is not a member of ‘v8’
../src/addon.h:12:44: error: expected primary-expression before ‘>’ token
../src/addon.h:12:46: error: ‘val’ was not declared in this scope
../src/addon.h:13:28: error: redefinition of ‘bool node::Buffer::HasInstance’
../src/addon.h:12:12: error: ‘bool node::Buffer::HasInstance’ previously defined here
../src/addon.h:13:24: error: ‘Handle’ is not a member of ‘v8’
../src/addon.h:13:45: error: expected primary-expression before ‘>’ token
../src/addon.h:13:47: error: ‘val’ was not declared in this scope
../src/addon.h:14:18: error: ‘Handle’ is not a member of ‘v8’
../src/addon.h:14:38: error: expected primary-expression before ‘>’ token
../src/addon.h:14:40: error: ‘val’ was not declared in this scope
../src/addon.h:15:22: error: redefinition of ‘char* node::Buffer::Data’
../src/addon.h:14:13: error: ‘char* node::Buffer::Data’ previously defined here
../src/addon.h:15:18: error: ‘Handle’ is not a member of ‘v8’
../src/addon.h:15:39: error: expected primary-expression before ‘>’ token
../src/addon.h:15:41: error: ‘val’ was not declared in this scope
../src/addon.h:16:21: error: ‘Handle’ is not a member of ‘v8’
../src/addon.h:16:41: error: expected primary-expression before ‘>’ token
../src/addon.h:16:43: error: ‘val’ was not declared in this scope
../src/addon.h:17:25: error: redefinition of ‘size_t node::Buffer::Length’
../src/addon.h:16:14: error: ‘size_t node::Buffer::Length’ previously defined here
../src/addon.h:17:21: error: ‘Handle’ is not a member of ‘v8’
../src/addon.h:17:42: error: expected primary-expression before ‘>’ token
../src/addon.h:17:44: error: ‘val’ was not declared in this scope
wiringPi.target.mk:135: recipe for target 'Release/obj.target/wiringPi/src/addon.o' failed
make: *** [Release/obj.target/wiringPi/src/addon.o] Error 1
make: Leaving directory '/home/pi/node_modules/wiring-pi/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.1.13+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/node_modules/wiring-pi
gyp ERR! node -v v6.8.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
done.
Enjoy !
/home/pi
└── wiring-pi@2.2.0
neojski commented 7 years ago

This solved the problem: https://github.com/fivdi/onoff/wiki/Node.js-v4-and-native-addons