KraigM / homebridge-gpio-garagedoor

RPi GPIO based Garage Door plugin for Homebridge
22 stars 11 forks source link

Cannot run gpio-garagedoor on rasp pi #17

Open backpacked opened 6 years ago

backpacked commented 6 years ago

Installed homebridge as per the instructions. Tried installing gpio-garagedoor with npm install -g homebridge-gpio-garagedoor but got error: gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/.node-gyp" gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/.node-gyp/9.4.0"

Then installed with --unsafe-perm but that did not work Tried su and as root tried but that failed too.

Keep getting: [2018-2-4 00:19:48] ERROR LOADING PLUGIN homebridge-gpio-garagedoor: [2018-2-4 00:19:48] Error: Could not locate the bindings file. Tried: → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/build/epoll.node → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/build/Debug/epoll.node → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/build/Release/epoll.node → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/out/Debug/epoll.node → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/Debug/epoll.node → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/out/Release/epoll.node → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/Release/epoll.node → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/build/default/epoll.node → /usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/compiled/9.4.0/linux/arm/epoll.node at bindings (/usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/bindings/bindings.js:88:9) at Object. (/usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/epoll/epoll.js:1:99) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:573:32) at tryModuleLoad (module.js:513:12) at Function.Module._load (module.js:505:3) at Module.require (module.js:604:17) at require (internal/module.js:11:18) at Object. (/usr/lib/node_modules/homebridge-gpio-garagedoor/node_modules/onoff/onoff.js:4:11) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:573:32) at tryModuleLoad (module.js:513:12) at Function.Module._load (module.js:505:3) at Module.require (module.js:604:17) [2018-2-4 00:19:48] ==================== [2018-2-4 00:19:48] Loaded config.json with 2 accessories and 0 platforms. [2018-2-4 00:19:48] --- [2018-2-4 00:19:48] Loading 2 accessories... [2018-2-4 00:19:48] [MyQ Garage] Initializing Chamberlain accessory... /usr/lib/node_modules/homebridge/lib/api.js:64 throw new Error("The requested accessory '" + name + "' was not registered by any plugin."); ^

Error: The requested accessory 'GPIOGarageDoor' was not registered by any plugin. at API.accessory (/usr/lib/node_modules/homebridge/lib/api.js:64:13) at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:264:42) at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:86:38) at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10) at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:573:32) at tryModuleLoad (module.js:513:12) at Function.Module._load (module.js:505:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:193:16) at bootstrap_node.js:617:3

Appreciate your help.

troystanway commented 6 years ago

I find if you use this command it should install okay. sudo npm install -g --unsafe-perm homebridge-gpio-garagedoor

backpacked commented 6 years ago

I tried that already. Still fails. Matter of fact, I read a lot of comments about gyp.

Kimovitzh commented 6 years ago

Go to /usr/lib/node_modules and do a:

sudo rm -rf homebridge-gpio-garagedoor

then:

cd sudo npm install -g --unsafe-perm homebridge-gpio-garagedoor