diff --git a/lib/client.js b/lib/client.js
index <HASH>..<HASH> 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -40,7 +40,6 @@ function Client (config) {
   }, [])
 
   events.EventEmitter.call(this)
-  this.on('error', function () {})
 }
 
 inherits(Client, events.EventEmitter)
@@ -210,7 +209,12 @@ Client.prototype.connect = function (callback) {
 
   mqttClient.on('error', function (error) {
     console.log(error.toString())
-    that.emit('error', error)
+    // Avoid emitting MQTT client errors if there are no registered listeners.
+    // Otherwise, the error would be unhandled and could, in Node.js, shut
+    // down the hosting process.
+    if (that.listenerCount('error') > 0) {
+      that.emit('error', error)
+    }
   })
 
   mqttClient.on('message', function (topic, rawMessage) {
Only emit mqtt client events when an error listener is registered