bokub / linky-cli

⛔️ DEPRECATED - A CLI tool to retrieve your Linky power consumption
GNU General Public License v3.0
19 stars 1 forks source link

URLSearchParams is not defined at runtime #1

Closed lionep closed 5 years ago

lionep commented 5 years ago

Nice tool ! I've an issue when running it from CLI :

# linky day
? What is your client area e-mail? mail@example.com
? What is your client area password? [hidden]
✖ Cannot retrieve consumption
ReferenceError: URLSearchParams is not defined

The package is installed globally, with node 8.12.0 and npm 6.4.1.

If you have any hint about this ?

bokub commented 5 years ago

Looks like it's a problem with this line.

According to the Node.js documentation, URLSearchParams is available on the global object in node 10 but not in earlier version.

I'm fixing it and adding tests on old node versions.

bokub commented 5 years ago

Please run npm i -g linky-cli again, then linky --version to be sure you have the 1.1.1

The problem should be fixed now

lionep commented 5 years ago

Perfect! It works fine now, thanks !