tim-hellhake / tradfri-adapter

Mozilla Public License 2.0
2 stars 4 forks source link

Missing dependency for node-dtls-client #1

Closed stefanreimers closed 4 years ago

stefanreimers commented 4 years ago

After installing the addon it fails to start. The message Cannot find module 'node-aead-crypto' appears. See according log excerpt:

2019-12-23 13:38:36.322 INFO   : Fetching add-on https://s3-us-west-2.amazonaws.com/mozilla-gateway-addons/tradfri-adapter-0.1.1.tgz as /tmp/ByLPkw/tradfri-adapter.tar.gz
2019-12-23 13:38:38.309 INFO   : Expanding add-on /tmp/ByLPkw/tradfri-adapter.tar.gz
2019-12-23 13:38:44.270 INFO   : Loading add-on: tradfri-adapter
2019-12-23 13:38:45.863 INFO   : tradfri: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
2019-12-23 13:38:47.142 INFO   : tradfri: Loading add-on tradfri-adapter from /home/pi/.mozilla-iot/addons/tradfri-adapter
2019-12-23 13:38:47.461 ERROR  : tradfri: { Error: Cannot find module 'node-aead-crypto'
2019-12-23 13:38:47.470 ERROR  : tradfri:     at Function.Module._resolveFilename (module.js:548:15)
2019-12-23 13:38:47.471 ERROR  : tradfri:     at Function.Module._load (module.js:475:25)
2019-12-23 13:38:47.473 ERROR  : tradfri:     at Module.require (module.js:597:17)
2019-12-23 13:38:47.474 ERROR  : tradfri:     at require (internal/module.js:11:18)
2019-12-23 13:38:47.476 ERROR  : tradfri:     at Object.<anonymous> (/home/pi/.mozilla-iot/addons/tradfri-adapter/node_modules/node-dtls-client/build/lib/AEADCrypto.js:54:47)
2019-12-23 13:38:47.478 ERROR  : tradfri:     at Module._compile (module.js:653:30)
2019-12-23 13:38:47.479 ERROR  : tradfri:     at Object.Module._extensions..js (module.js:664:10)
2019-12-23 13:38:47.481 ERROR  : tradfri:     at Module.load (module.js:566:32)
2019-12-23 13:38:47.482 ERROR  : tradfri:     at tryModuleLoad (module.js:506:12)
2019-12-23 13:38:47.484 ERROR  : tradfri:     at Function.Module._load (module.js:498:3) code: 'MODULE_NOT_FOUND' }

Dependecies can be installed via ssh on RPi with npm install --only=prod. The installation concludes with the warning that 55 security issues exist for the package - but thats more of an issue of node-dtls-client. For tradfri-adapter a npm audit fix --force helps and leaves a working adapter.

tim-hellhake commented 4 years ago

The message Cannot find module 'node-aead-crypto' appears

I was under the impression that it's a pure js lib because of the sentence This library provides the missing native DTLS support in the readme. Seems like we need a cross-compiled build here.

The installation concludes with the warning that 55 security issues exist for the package

Interesting, If I run npm audit locally I get 0 vulnerabilities:

found 0 vulnerabilities
 in 118 scanned packages
stefanreimers commented 4 years ago

Interesting, If I run npm audit locally I get 0 vulnerabilities:

Made a clean install of the tradfri-adapter and installed dependencies. Issue remains grafik

stefanreimers commented 4 years ago

@tim-hellhake: Did you install prod dependencies in the adapter itself or the subdirectory of node-dtls-client?

tim-hellhake commented 4 years ago

Did you install prod dependencies in the adapter itself or the subdirectory of node-dtls-client?

In the adapter itself.

Sorry if I forgot to mention that the new update is available. Is everything working now?

stefanreimers commented 4 years ago

Installed the adapter on two instances (RPi 3/4, both running Gateway v.0.11.0). Works fine in both cases.