andrewjensen / light-blocks

Control Philips Hue lights with Blocks!
4 stars 1 forks source link

createuserjson #2

Closed rishi438 closed 8 months ago

rishi438 commented 2 years ago

When I tried to run createuser.js this is the issue could please help me with that

  throw new ApiError(`Problems resolving hue bridges, ${err.message}`);
        ^

ApiError: Problems resolving hue bridges, unable to get local issuer certificate at C:\Users\rishi\Desktop\React_Native\react\light-blocks-master\scripts\node_modules\node-hue-api\lib\api\discovery\nupnp.js:15:13 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async discoverBridge (C:\Users\rishi\Desktop\React_Native\react\light-blocks-master\scripts\createUser.js:10:28) at async discoverAndCreateUser (C:\Users\rishi\Desktop\React_Native\react\light-blocks-master\scripts\createUser.js:22:21)

rishi438 commented 2 years ago

I also tried to run on my local server but there is div issue https://drive.google.com/file/d/1n6zOCZHlV6It78p8H58lJQgj5wtIping/view?usp=sharing please help with this

andrewjensen commented 2 years ago

Hi @rishi438, thanks for the issue report. I tried running the createUser.js script after being away for a while and it failed for me too.

I did some searching and found this closed issue in the node-hue-api library: https://github.com/peter-murray/node-hue-api/issues/208

Looks like there was an issue with previous versions of the library but it was fixed in 5.0.0-beta.10. Light-blocks is still pointing to version ^5.0.0-beta.2, so we probably just need to pin a newer version of the dependency. Could you try updating locally and see if that fixes the certificate issue?

andrewjensen commented 2 years ago

Oops, just remembered that the scripts directory has its own package file, and it's using version 4 of node-hue-api. I must have copy-pasted from somewhere to get up and running and never updated to match the server 🤦‍♂️

If you edit scripts/package.json and request node-hue-api at ^4.0.11, the issue seems to go away.

I'll push a fix once I get the chance.

andrewjensen commented 8 months ago

Hi @rishi438, sorry for being so slow getting back to you! I looked into this and couldn't find a convenient way to get the script working, but then I realized that the Philips Hue docs have a pretty good getting started guide for generating the env vars needed. So I updated the project README to link to the instructions.