konsumer / tplink-lightbulb

Control TP-Link smart lightbulbs from nodejs
MIT License
191 stars 32 forks source link

TypeError: undefined is not a function - check for existence of Buffer.from #9

Closed CantonsCobb closed 7 years ago

CantonsCobb commented 7 years ago

After installing the tplink-lightbulb package, I have come across an error stating "TypeError: undefined is not a function." From the attached image, it is shown that tplight has been installed via the command prompt that displays the help menu for the scan command. However when attempting to run the scan, the "TypeError" message appears. The scan is not performed. In addition, I have successfully pinged the IP of the bulb, and tried the on/off commands. The commands to not trigger a response in the bulb, nor do they throw an error.

It is very possible I made an error on install. Please let me know if there is more information I need to provide.

typeerror

konsumer commented 7 years ago

There was a change with how to make a new buffer from a string, with node. The old method is deprecated, so I use the new syntax. Please upgrade your node install.

CantonsCobb commented 7 years ago

That was it, thank you very much. A minimum version number in the readme may be helpful for future users.

konsumer commented 7 years ago

That is a great idea. I was also thinking about testing for Buffer.from. When I get a minute, I'll change the code. For now, I changed the title of the issue. Thanks for the report.

konsumer commented 7 years ago

Resolved in f777b8ec9406d2c8775a89b599a164ff049c700c