Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mqtt.createClient is not a function #5

Open
fspasovski opened this issue Jul 26, 2018 · 3 comments
Open

mqtt.createClient is not a function #5

fspasovski opened this issue Jul 26, 2018 · 3 comments

Comments

@fspasovski
Copy link

Hello,
When executing the command:
mqtt-exec -c /usr/lib/node_modules/mqtt-exec/config-example.json -h mqtt://localhost:1883
I get the next error on the line bellow:
/usr/lib/node_modules/mqtt-exec/mqtt-exec.js:49
var c = mqtt.createClient(mqtt_url.port, mqtt_url.hostname, {

TypeError: mqtt.createClient is not a function
    at Object.<anonymous> (/usr/lib/node_modules/mqtt-exec/mqtt-exec.js:49:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

Do you have any idea what's the problem?

@SIM0N-F
Copy link

SIM0N-F commented Jan 26, 2019

Hi, I have same problem on my debian 9.6 @fspasovski you have solved this issue ?

This by advance.

@Xavelyn
Copy link

Xavelyn commented Jan 7, 2021

If somebody is interested in my solution for this problem: https://pastebin.com/kv9Nc5zW
Just copy the code from the link and replace it into /usr/local/lib/node_modules/mqtt-exec/mqtt-exec.js

@thiagolcordeiro
Copy link

Hello @Xavelyn
this link if off?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants