robertklep / homebridge-nefit-easy

DEPRECATED — Homebridge plugin for Nefit Easy™
14 stars 3 forks source link

Unable to install 'homebridge-nefit-easy' #15

Closed bengpearson closed 5 years ago

bengpearson commented 5 years ago

When trying to run:

npm i homebridge-nefit-easy -g

Getting the following error:

`(node:19155) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. [29/12/2018, 20:16:56] There was a problem reading your config.json file. [29/12/2018, 20:16:56] Please try pasting your config.json file here to validate it: http://jsonlint.com [29/12/2018, 20:16:56] /usr/local/lib/node_modules/homebridge/lib/server.js:214 throw err; ^

SyntaxError: Unexpected token : in JSON at position 13 at JSON.parse () at Server._loadConfig (/usr/local/lib/node_modules/homebridge/lib/server.js:208:19) at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:56:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:30:16) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) pi@raspberrypi:/usr/local/lib/node_modules $ npm i homebridge-nefit-easy -g (node:19263) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. npm ERR! error rolling back Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/md5.js/node_modules/safe-buffer' npm ERR! error rolling back node-xmpp-client@3.2.0 { Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/md5.js/node_modules/safe-buffer' npm ERR! error rolling back errno: -39, npm ERR! error rolling back code: 'ENOTEMPTY', npm ERR! error rolling back syscall: 'rmdir', npm ERR! error rolling back path: '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/md5.js/node_modules/safe-buffer' } npm ERR! error rolling back Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/sasl-scram-sha-1/node_modules/create-hash/node_modules/sha.js' npm ERR! error rolling back nefit-easy-core@4.0.0 { Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/sasl-scram-sha-1/node_modules/create-hash/node_modules/sha.js' npm ERR! error rolling back errno: -39, npm ERR! error rolling back code: 'ENOTEMPTY', npm ERR! error rolling back syscall: 'rmdir', npm ERR! error rolling back path: '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/sasl-scram-sha-1/node_modules/create-hash/node_modules/sha.js' } npm ERR! tar.unpack untar error /home/pi/.npm/safe-buffer/5.1.2/package.tgz npm ERR! error rolling back Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/ws/node_modules/options' npm ERR! error rolling back nefit-easy-commands@3.0.4 { Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/ws/node_modules/options' npm ERR! error rolling back errno: -39, npm ERR! error rolling back code: 'ENOTEMPTY', npm ERR! error rolling back syscall: 'rmdir', npm ERR! error rolling back path: '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/ws/node_modules/options' } npm ERR! tar.unpack untar error /home/pi/.npm/ultron/1.0.2/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/sha.js/2.4.11/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/safe-buffer/5.1.2/package.tgz npm ERR! error rolling back Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/request/node_modules/safe-buffer' npm ERR! error rolling back homebridge-nefit-easy@2.1.1 { Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/request/node_modules/safe-buffer' npm ERR! error rolling back errno: -39, npm ERR! error rolling back code: 'ENOTEMPTY', npm ERR! error rolling back syscall: 'rmdir', npm ERR! error rolling back path: '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/request/node_modules/safe-buffer' } npm ERR! Error: Method Not Allowed npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10) npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12 npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7) npm ERR! at FSReqWrap.oncomplete (fs.js:135:15) npm ERR! If you need help, you may report this entire log, npm ERR! including the npm and node versions, at: npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 4.14.79-v7+ npm ERR! command "/usr/bin/node" "/usr/bin/npm" "i" "homebridge-nefit-easy" "-g" npm ERR! cwd /usr/local/lib/node_modules npm ERR! node -v v8.11.1 npm ERR! npm -v 1.4.21 npm ERR! code E405 npm ERR! tar.unpack untar error /home/pi/.npm/uuid/3.3.2/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/aws4/1.8.0/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/qs/6.5.2/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/isstream/0.1.2/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/http-signature/1.2.0/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/extend/3.0.2/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/json-stringify-safe/5.0.1/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/form-data/2.3.3/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/safe-buffer/5.1.2/package.tgz npm ERR! tar.unpack untar error /home/pi/.npm/tough-cookie/2.4.3/package.tgz npm ERR! error rolling back Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/request/node_modules/performance-now' npm ERR! error rolling back request@2.88.0 { Error: ENOTEMPTY: directory not empty, rmdir '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/request/node_modules/performance-now' npm ERR! error rolling back errno: -39, npm ERR! error rolling back code: 'ENOTEMPTY', npm ERR! error rolling back syscall: 'rmdir', npm ERR! error rolling back path: '/usr/local/lib/node_modules/homebridge-nefit-easy/node_modules/nefit-easy-commands/node_modules/nefit-easy-core/node_modules/node-xmpp-client/node_modules/request/node_modules/performance-now' } npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /usr/local/lib/node_modules/npm-debug.log npm ERR! not ok code 0`

pi@raspberrypi:~/.homebridge $ node --version v8.11.1

Unable to use plugin as a result if you can assist? Thanks.

robertklep commented 5 years ago

For starters, you're using a very old version of npm. Try upgrading that first:

npm i npm -g

(possibly prefixed by sudo to run the command as root)

bengpearson commented 5 years ago

That was a silly oversight. All working now, thank you!

robertklep commented 5 years ago

Cool, easiest fix ever 😂

lyndhurst6 commented 5 years ago

Robert, I can't install this either. I get... [1/2/2019, 6:24:50 PM] Loaded config.json with 1 accessories and 0 platforms. [1/2/2019, 6:24:50 PM] --- [1/2/2019, 6:24:50 PM] No plugins found. See the README for information on installing plugins. [1/2/2019, 6:24:50 PM] Loading 0 platforms... [1/2/2019, 6:24:50 PM] Loading 1 accessories... /usr/local/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 'Boiler' was not registered by any plugin. at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:286:42) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:87:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:45:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3)

Any help gratefully received but please be gentle - first Time in terminal! Mal

robertklep commented 5 years ago

@lyndhurst6 sounds like a config.json problem. Feel free to e-mail it to me (robert AT klep DOT name) so I can take a look at it :)

lyndhurst6 commented 5 years ago

Thanks Robert, its defiantly me! Ive just found the new version of the plugin and now got this

Last login: Wed Jan 2 18:23:13 on ttys000 Malcolms-iMac:~ malcolmlang$ homebridge [1/2/2019, 6:24:50 PM] Loaded config.json with 1 accessories and 0 platforms. [1/2/2019, 6:24:50 PM] --- [1/2/2019, 6:24:50 PM] No plugins found. See the README for information on installing plugins. [1/2/2019, 6:24:50 PM] Loading 0 platforms... [1/2/2019, 6:24:50 PM] Loading 1 accessories... /usr/local/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 'Boiler' was not registered by any plugin. at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:286:42) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:87:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:45:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) Malcolms-iMac:~ malcolmlang$ npm i homebridge-nefit-easy npm WARN saveError ENOENT: no such file or directory, open '/Users/malcolmlang/package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open '/Users/malcolmlang/package.json' npm WARN malcolmlang No description npm WARN malcolmlang No repository field. npm WARN malcolmlang No README data npm WARN malcolmlang No license field.

Thanks again!

robertklep commented 5 years ago

@lyndhurst6 ah, you need to install the Nefit plugin "globally":

npm i homebridge-nefit-easy -g

(possibly using sudo: sudo npm i homebridge-nefit-easy -g)

lyndhurst6 commented 5 years ago

The global command didn’t work but the sudo did- thank you so much! Now to pair!

On 2 Jan 2019, at 18:50, Robert Klep notifications@github.com wrote:

sudo npm i homebridge-nefit-easy -g

lyndhurst6 commented 5 years ago

Robert, Sorry to be a pain but I now get this. Am I editing the config file correctly? Its my bridge with details and Ive changed the accessory to match my thermostat, is that correct?

Last login: Wed Jan 2 19:34:39 on ttys000 Malcolms-iMac:~ malcolmlang$ homebridge [1/2/2019, 8:01:22 PM] Loaded config.json with 1 accessories and 0 platforms. [1/2/2019, 8:01:22 PM] --- [1/2/2019, 8:01:22 PM] Loaded plugin: homebridge-nefit-easy [1/2/2019, 8:01:22 PM] Registering accessory 'homebridge-nefit-easy.NefitEasy' [1/2/2019, 8:01:22 PM] --- [1/2/2019, 8:01:22 PM] Loading 0 platforms... [1/2/2019, 8:01:22 PM] Loading 1 accessories... /usr/local/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 'NetfitEasy' was not registered by any plugin. at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:286:42) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:87:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:45:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) at Function.Module.runMain (internal/modules/cjs/loader.js:774:12) at executeUserCode (internal/bootstrap/node.js:342:17) at startExecution (internal/bootstrap/node.js:276:5) at startup (internal/bootstrap/node.js:227:5) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3) Malcolms-iMac:~ malcolmlang$

lyndhurst6 commented 5 years ago

OK I give up, this is too much for me! Thanks for your help though Mal

On 2 Jan 2019, at 18:50, Robert Klep notifications@github.com wrote:

@lyndhurst6 https://github.com/lyndhurst6 ah, you need to install the Nefit plugin "globally":

npm i homebridge-nefit-easy -g (possibly using sudo: sudo npm i homebridge-nefit-easy -g)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robertklep/homebridge-nefit-easy/issues/15#issuecomment-450949015, or mute the thread https://github.com/notifications/unsubscribe-auth/AsLm-1maGa_kw5Ewq7wQzljVoOlyTw8Zks5u_P9YgaJpZM4ZkthH.

robertklep commented 5 years ago

@lyndhurst6 notice the typo, "NetfitEasy" instead of "NefitEasy".

lyndhurst6 commented 5 years ago

Robert, One more go, Ive got the config file sorted I think, but does the screenshot mean the plugin works but not the server?

Last login: Fri Jan 4 19:07:56 on ttys000 Malcolms-iMac:~ malcolmlang$ homebridge [1/4/2019, 7:09:00 PM] Loaded config.json with 1 accessories and 0 platforms. [1/4/2019, 7:09:00 PM] --- [1/4/2019, 7:09:00 PM] Loaded plugin: homebridge-nefit-easy [1/4/2019, 7:09:00 PM] Registering accessory 'homebridge-nefit-easy.NefitEasy' [1/4/2019, 7:09:00 PM] --- [1/4/2019, 7:09:00 PM] Loading 0 platforms... [1/4/2019, 7:09:00 PM] Loading 1 accessories... /usr/local/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 'NetfitEasy' was not registered by any plugin. at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:286:42) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:87:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:45:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) at Function.Module.runMain (internal/modules/cjs/loader.js:774:12) at executeUserCode (internal/bootstrap/node.js:342:17) at startExecution (internal/bootstrap/node.js:276:5) at startup (internal/bootstrap/node.js:227:5) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3) Malcolms-iMac:~ malcolmlang$

On 2 Jan 2019, at 18:50, Robert Klep notifications@github.com wrote:

sudo: sudo npm i homebridge-nefit-easy -g

robertklep commented 5 years ago

I'm missing a screenshot and seeing the same (incorrect) error log :)

lyndhurst6 commented 5 years ago

Hi Robert Im still trying! Same error code

I am sure its my config file

Not too sure how the config file should look, is mine correct? Thanks again, Mal

robertklep commented 5 years ago

@lyndhurst6 you didn't attach your config file.

lyndhurst6 commented 5 years ago

Thanks for looking! Mal

On 10 Jan 2019, at 20:50, Robert Klep notifications@github.com wrote:

@lyndhurst6 https://github.com/lyndhurst6 you didn't attach your config file.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robertklep/homebridge-nefit-easy/issues/15#issuecomment-453248610, or mute the thread https://github.com/notifications/unsubscribe-auth/AsLm--ki15MEj_W5KfLwRdEbglHWrZRYks5vB6eWgaJpZM4ZkthH.

robertklep commented 5 years ago

@lyndhurst6 I can't look at it if you don't send it to me :)

lyndhurst6 commented 5 years ago

The file is attached I think

On 10 Jan 2019, at 20:55, Robert Klep notifications@github.com wrote:

@lyndhurst6 https://github.com/lyndhurst6 I can't look at it if you don't send it to me :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robertklep/homebridge-nefit-easy/issues/15#issuecomment-453250200, or mute the thread https://github.com/notifications/unsubscribe-auth/AsLm-97a_V39OOK3wkx2tF-GFYl_2fbEks5vB6jBgaJpZM4ZkthH.

robertklep commented 5 years ago

It's not attached, probably because you're replying to Github comments that appear on the Github website automatically (here).

Please e-mail me directly: robert AT klep DOT name (replace AT with @ and DOT with .)