sammy1881 / homebridge-sengled-bulbs

Homebridge plug-in for Sengled zigged bulbs
2 stars 4 forks source link

Error: Cannot find module 'tough-cookie' #2

Closed RandyTidd closed 2 years ago

RandyTidd commented 2 years ago

First time running this plugin, it wasn't working. Homebridge logs showed:

Error: Cannot find module 'tough-cookie' // Full error below

Running the npm install command manually revealed that axios has a peer dependency on tough-cookie:

npm WARN axios-cookiejar-support@1.0.1 requires a peer of @types/tough-cookie@>=2.3.3 but none is installed. You must install peer dependencies yourself. npm WARN axios-cookiejar-support@1.0.1 requires a peer of tough-cookie@>=2.3.3 but none is installed. You must install peer dependencies yourself.

Apparently some older versions of NPM do not install peer dependencies. I'm running Ubuntu 20.04.2 LTS (GNU/Linux 5.11.0-38-generic x86_64) which has older npm version 6.14.15 at the moment , but might be somewhat common. I don't know how to work around this to make it automatic as part of the plugin install, and it may not be worth trying given that having a newer NPM should fix it. I thought I'd file an issue in case it saves someone else some time. Personally, I ran 'sudo npm install tough-cookie@latest' to fix.

[11/13/2021, 5:03:52 PM] ERROR LOADING PLUGIN homebridge-sengled-bulbs: [11/13/2021, 5:03:52 PM] Error: Cannot find module 'tough-cookie' Require stack:

sammy1881 commented 2 years ago

Should be fixed by https://github.com/sammy1881/homebridge-sengled-bulbs/pull/4

RandyTidd commented 2 years ago

Thanks!