Q:

MQTT Client for node.js TypeError

I try to understand and implement the MQTT-Client for node.js, which can be found at: http://jahbromo.blogspot.de/2011/12/client-mqttt-javascript.html
I keep getting:
 var client = new mqtt.MQTTClient(1883,'127.0.0.1','mirror');
              ^
TypeError: undefined is not a function
I'm relatively new to  node.js I don't understand why node.js is giving this error

A:

So first of all it is worth knowing that that blog stole the content from the original author here: http://ceit.uq.edu.au/content/simple-mqtt-cient-nodejs
Yilun's code is on Github but hasn't been updated in a couple of years.
https://github.com/yilun/node_mqtt_client
I would recommend taking a look at the mqttjs node module instead.
https://github.com/adamvr/MQTT.js
That has some good examples which enable you to create a client quite easily.

