nalajcie / tuya-cloud-to-influxdb

Use Tuya cloud API to push data from devices to influxdb
19 stars 1 forks source link

TypeError: Cannot destructure property 'uri' of 'config.get(...)' as it is undefined. #9

Closed christrt9 closed 2 years ago

christrt9 commented 3 years ago

hi :)

I get this error with ./cli.js or anything :/

`/home/me/tuya-cloud-to-influxdb/lib/common.js:88 const {uri} = config.get('influx'); ^

TypeError: Cannot destructure property 'uri' of 'config.get(...)' as it is undefined. `

nalajcie commented 3 years ago

Sorry for not responding right away. Please note that I've converted all my devices to Tasmota so I might be unable to help.

Did You do npm install to install all dependencies before trying to run cli.js?

What version of NodeJS are You using? (I've tested it just now on v10.22.0)

christrt9 commented 3 years ago

hi thanks for the reply. Yes i run npm install

Nodejs: v14.17.2

└─[0] <git:(master 80a3583) > npm install
audited 549 packages in 3.244s
found 3 vulnerabilities (1 low, 1 moderate, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details
└─[0] <git:(master 80a3583) > nodejs cli.js   
tuya-cloud-to-influxdb/lib/common.js:88
  const {uri} = config.get('influx');
         ^

TypeError: Cannot destructure property 'uri' of 'config.get(...)' as it is undefined.
    at Object.initInflux (tuya-cloud-to-influxdb/lib/common.js:88:10)
    at Object.<anonymous> (tuya-cloud-to-influxdb/cli.js:21:25)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    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:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47
cyrilpascal commented 2 years ago

Hello Same problem ; may i have some help ? PS C:\Users\cyril\Documents\PlatformIO\Projects\tuya-cloud-to-influxdb> node cli.js C:\Users\cyril\Documents\PlatformIO\Projects\tuya-cloud-to-influxdb\lib\common.js:88 const {uri} = config.get('influx'); ^

TypeError: Cannot destructure property 'uri' of 'config.get(...)' as it is undefined. at Object.initInflux (C:\Users\cyril\Documents\PlatformIO\Projects\tuya-cloud-to-influxdb\lib\common.js:88:10) at Object. (C:\Users\cyril\Documents\PlatformIO\Projects\tuya-cloud-to-influxdb\cli.js:21:25) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47

Node.js v18.12.1 PS C:\Users\cyril\Documents\PlatformIO\Projects\tuya-cloud-to-influxdb>

nalajcie commented 2 years ago

deprecated js syntax, fixed in f8fdaee7628b280db3b2340f2c1552d2b779a4a8