robertklep / homebridge-klikaanklikuit

Homebridge plugin for KlikAanKlikUit outlets
15 stars 7 forks source link

Gyp probleem #33

Open remko2000 opened 4 years ago

remko2000 commented 4 years ago

I ty to installe this plugin but I get:

gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack TypeError: tar.extract is not a function gyp ERR! stack at Request. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:198:22) gyp ERR! stack at Request.emit (events.js:323:22) gyp ERR! stack at Request.onRequestResponse (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1066:10) gyp ERR! stack at ClientRequest.emit (events.js:311:20) gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:603:27) gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17) gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:476:22) gyp ERR! stack at TLSSocket.emit (events.js:311:20) gyp ERR! stack at addChunk (_stream_readable.js:294:12) gyp ERR! stack at readableAddChunk (_stream_readable.js:275:11) gyp ERR! System Linux 4.19.97+ 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 /usr/local/lib/node_modules/homebridge-klikaanklikuit/node_modules/rpio gyp ERR! node -v v12.16.1 gyp ERR! node-gyp -v v5.0.5 gyp ERR! This is a bug in node-gyp. gyp ERR! Try to update node-gyp and file an Issue if it does not help: gyp ERR! https://github.com/nodejs/node-gyp/issues npm ERR! code ELIFECYCLE npm ERR! errno 7 npm ERR! rpio@1.7.1 install: node-gyp rebuild npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the rpio@1.7.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

My raspberry is up to date with the last software so what can be the problem here?

robertklep commented 4 years ago

This issue (and specifically this comment) suggests it may be an issue with mixed installs (different versions of Node.js installed).

I notice that you're using node-gyp@5.0.5, but the current version is node-gyp@6.1.0 so it might be worthwhile to upgrade that package first and see if that fixes the problem:

$ sudo npm i -g node-gyp

In any case, it's not specifically an issue with homebridge-klikaanklikuit.

remko2000 commented 4 years ago

Strange, I updated gyp but still errors and it refers to the old gyp version:

pi@raspberrypi:~ $ sudo npm i -g node-gyp npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 /usr/local/bin/node-gyp -> /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js

  • node-gyp@6.1.0 updated 1 package in 61.993s pi@raspberrypi:~ $ sudo npm install -g --unsafe-perm homebridge-klikaanklikuit

rpio@1.7.1 install /usr/local/lib/node_modules/homebridge-klikaanklikuit/node_modules/rpio node-gyp rebuild

gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack TypeError: tar.extract is not a function gyp ERR! stack at Request. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:198:22) gyp ERR! stack at Request.emit (events.js:323:22) gyp ERR! stack at Request.onRequestResponse (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1066:10) gyp ERR! stack at ClientRequest.emit (events.js:311:20) gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:603:27) gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17) gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:476:22) gyp ERR! stack at TLSSocket.emit (events.js:311:20) gyp ERR! stack at addChunk (_stream_readable.js:294:12) gyp ERR! stack at readableAddChunk (_stream_readable.js:275:11) gyp ERR! System Linux 4.19.97+ 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 /usr/local/lib/node_modules/homebridge-klikaanklikuit/node_modules/rpio gyp ERR! node -v v12.16.1 gyp ERR! node-gyp -v v5.0.5 gyp ERR! This is a bug in node-gyp. gyp ERR! Try to update node-gyp and file an Issue if it does not help: gyp ERR! https://github.com/nodejs/node-gyp/issues npm ERR! code ELIFECYCLE npm ERR! errno 7 npm ERR! rpio@1.7.1 install: node-gyp rebuild npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the rpio@1.7.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! /root/.npm/_logs/2020-03-21T11_06_15_831Z-debug.log

robertklep commented 4 years ago

and it refers to the old gyp version

It looks like npm is using a version that is packaged specifically with it (installed in /usr/local/lib/node_modules/npm/node_modules/node-gyp/).

Which version of npm are you using? Perhaps that's needs upgrading too (sudo npm i -g npm).

remko2000 commented 4 years ago

Indeed after updating npm I could install. Now I'm struggling with the json. Is there maybe a error in it? This is my config now:

{ "bridge": { "name": "Homebridge 82AE", "username": "0E:44:7B:CC:82:AE", "port": 51400, "pin": "340-42-632" }, "platforms": [ { "name": "Config", "port": 8581, "platform": "config" }, { "platform": "KlikAanKlikUit", "driver": { "type": "rpi", "pin": 6 }, "accessories": [ { "name": "Light Closet", "type": "Outlet", "dimmable": false, "address": "0000e1", "device": "2" } ] ] } }

But I get an syntaxerror. I dont't see where the mistake is.

robertklep commented 4 years ago
{
  "bridge": {
    "name": "Homebridge 82AE",
    "username": "0E:44:7B:CC:82:AE",
    "port": 51400,
    "pin": "340-42-632"
  },
  "platforms": [
    {
      "name": "Config",
      "port": 8581,
      "platform": "config"
    },
    {
      "platform": "KlikAanKlikUit",
      "driver": {
        "type": "rpi",
        "pin": 6
      },
      "accessories": [
        {
          "name": "Light Closet",
          "type": "Outlet",
          "dimmable": false,
          "address": "0000e1",
          "device": "2"
        }
      ]
    }
  ]
}
remko2000 commented 4 years ago

thx, that do the job.

Homebridge GUI gives me now:

Error: Unable to load driver 'rpi': Pin 6 is not valid when using physical mapping at new KaKuPlatform (/usr/local/lib/node_modules/homebridge-klikaanklikuit/index.js:26:13) at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:337:32) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:90:36) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)

remko2000 commented 4 years ago

I change it to 8 and now I don't have errors anymore. I will test my transmitter now :-)