sebmos / homebridge-eufy

EufyHome (Anker) Plugin for Homebridge, based on node-eufy-api
Apache License 2.0
24 stars 6 forks source link

0.4.0 fails to load, 0.3.5 loads fine #21

Open ihatemyisp opened 2 years ago

ihatemyisp commented 2 years ago

NodeJS: 14.9.1 Homebridge: 1.4.0

[4/6/2022, 8:02:33 PM] ERROR LOADING PLUGIN homebridge-eufy:
[4/6/2022, 8:02:33 PM] /usr/lib/node_modules/homebridge-eufy/node_modules/node-eufy-api/lib/index.js:1
import fetch from "node-fetch";
^^^^^^
SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:1001:16)
    at Module._compile (internal/modules/cjs/loader.js:1049:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge-eufy/lib/index.js:2:23)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[4/6/2022, 8:02:33 PM] ====================

I saw #20 and think this might be similar.

When I check node-eufy-api's package.json I see this:

  "_from": "node-eufy-api@^0.4.0",
  "_id": "node-eufy-api@0.4.1",
  "_inBundle": false,
  "_integrity": "sha512-m5Kg5USpK8r+rxEoF1fJtIZpt5Gb/DT+ze1T6b0h4tVc2skicdqxtRd0YB1j+pY6v/dqOzRUuMc1PQ+6BlXwMg==",
  "_location": "/homebridge-eufy/node-eufy-api",
  "_phantomChildren": {},
  "_requested": {
    "type": "range",
    "registry": true,
    "raw": "node-eufy-api@^0.4.0",
    "name": "node-eufy-api",
    "escapedName": "node-eufy-api",
    "rawSpec": "^0.4.0",
    "saveSpec": null,
    "fetchSpec": "^0.4.0"
  },

I don't know enough about node to tell if that means 0.4.1 or 0.4.0 is installed.

Either way, 0.3.5 works fine so I'll keep using that until I can get this resolved. Any ideas?

ChadyG commented 2 years ago

Same error here

NodeJS: 14.9.1 NPM: 8.6.0 homebridge-eufy: 0.4.0 node-eufy-api: 0.4.1

ibmaster commented 1 year ago

Does 0.4.0 version actually work for anybody??