CommonGarden/Fermenter

Npm install fails on Raspberry pi 3

Closed this issue · 2 comments


> raspi-gpio@2.3.1 install /home/pi/BioReactor/driver/node_modules/raspi-gpio
> node-gyp rebuild

make: Entering directory '/home/pi/BioReactor/driver/node_modules/raspi-gpio/build'
  CXX(target) Release/obj.target/addon/src-native/addon.o
  CXX(target) Release/obj.target/addon/src-native/init.o
../src-native/init.cc:27:22: fatal error: wiringPi.h: No such file or directory
 #include <wiringPi.h>
                      ^
compilation terminated.
addon.target.mk:96: recipe for target 'Release/obj.target/addon/src-native/init.o' failed
make: *** [Release/obj.target/addon/src-native/init.o] Error 1
make: Leaving directory '/home/pi/BioReactor/driver/node_modules/raspi-gpio/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:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.9.41-v7+
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/BioReactor/driver/node_modules/raspi-gpio
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN Raspberry-Pi-Grow-Hub@0.2.0 No description
npm WARN Raspberry-Pi-Grow-Hub@0.2.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! raspi-gpio@2.3.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the raspi-gpio@2.3.1 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/2017-10-07T00_27_19_295Z-debug.log

Fixed with:
sudo apt-get install wiringpi

Note you will need to remove the node_modules folder and run npm install.