var mqtt = require('mqtt'); results in error

716 views
Skip to first unread message

raxm...@gmail.com

unread,
Sep 19, 2013, 9:45:15 AM9/19/13
to mq...@googlegroups.com
Hello Experts,
I have installed node.js and then executed npm install mqtt from node.js command line to install mqtt.js.
Now to test mqtt client I am trying to execute :
var sys = require('sys');
var net = require('net');
var mqtt = require('mqtt');


var mqtt = require('mqtt'); line results in error saying:
Error: Cannot find module 'mqtt'
.     at Function.Module._resolveFilename (module.js:338:15)
.     at Function.Module._load (module.js:280:25)
.     at Module.require (module.js:364:17)
.     at require (module.js:380:17)
.     at repl:1:12
.     at REPLServer.self.eval (repl.js:110:21)
.     at repl.js:249:20
.     at REPLServer.self.eval (repl.js:122:7)
.     at Interface.<anonymous> (repl.js:239:12)
.     at Interface.EventEmitter.emit (events.js:95:17)

Could you please guide me resolving this issue.
Thanks,
Rakesh

Nicholas O'Leary

unread,
Sep 19, 2013, 10:02:02 AM9/19/13
to mq...@googlegroups.com
Hi Rakesh,

this list is about the protocol, rather than any particular implementation.

At first glance, I can't see anything obviously wrong with what you say you have done.

In a clean directory, I just ran 'npm install mqtt', ran node interactively and tried a  require('mqtt') - which all worked fine.

You may want to follow-up with the guys behind the mqtt node.js module - https://github.com/adamvr/MQTT.js

Regards,
Nick


--
--
To learn more about MQTT please visit http://mqtt.org
 
To post to this group, send email to mq...@googlegroups.com
To unsubscribe from this group, send email to
mqtt+uns...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/mqtt
 
---
You received this message because you are subscribed to the Google Groups "MQ Telemetry Transport" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Mark Lommers

unread,
Sep 24, 2013, 7:17:08 AM9/24/13
to mq...@googlegroups.com
did you do the install on the same level as where you are running the node command?

Op donderdag 19 september 2013 16:02:02 UTC+2 schreef knolleary:
Reply all
Reply to author
Forward
0 new messages