dubocr / homebridge-gpio-device

Homebridge GPIO device expose several HomeKit accessories interacting with GPIO
Apache License 2.0
65 stars 22 forks source link

Failed to install #65

Open iondarie opened 5 years ago

iondarie commented 5 years ago

Hello i am trying to install the plugin but i get the following error please help.

Thank you

sudo npm install -g homebridge-gpio-device --unsafe-perm

node-wiring-pi@0.0.4 install /usr/local/lib/node_modules/homebridge-gpio-device/node_modules/node-wiring-pi /bin/bash ./install.sh

Checking for wiringpi: install ok installed Building node-wiring-pi ... make: Entering directory '/usr/local/lib/node_modules/homebridge-gpio-device/node_modules/node-wiring-pi/build' CXX(target) Release/obj.target/nodeWiringPi/src/addon.o In file included from ../../nan/nan.h:54:0, from ../src/addon.h:10, from ../src/addon.cc:2: /root/.node-gyp/12.3.0/include/node/node.h:107:24: fatal error: util-inl.h: No such file or directory

include

compilation terminated. nodeWiringPi.target.mk:122: recipe for target 'Release/obj.target/nodeWiringPi/src/addon.o' failed make: *** [Release/obj.target/nodeWiringPi/src/addon.o] Error 1 make: Leaving directory '/usr/local/lib/node_modules/homebridge-gpio-device/node_modules/node-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:262:23) gyp ERR! stack at ChildProcess.emit (events.js:200:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Linux 4.19.42-v7+ gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" gyp ERR! cwd /usr/local/lib/node_modules/homebridge-gpio-device/node_modules/node-wiring-pi gyp ERR! node -v v12.3.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

toshibochan commented 5 years ago

I was able to install after I did this:

Install wiringpi:

sudo apt-get purge wiringpi hash -r sudo apt-get install git-core git clone git://git.drogon.net/wiringPi cd ~/wiringPi ./build

Uninstall wiringpi:

cd ~/wiringPi ./build uninstall

install wiringpi-2.46-1:

cd /tmp wget https://unicorn.drogon.net/wiringpi-2.46-1.deb sudo dpkg -i wiringpi-2.46-1.deb

install homebridge-gpio-device: sudo npm install -g homebridge-gpio-device --unsafe-perm

iondarie commented 5 years ago

ok so it seems that my errors are caused by node.js v12. any chance you can update the script to be node 12 compatible?