MQTT in AWS Lambda function for Alexa Javascript
问题 Please help, I need to use mqtt protocol in lambda function to send some data to a broker. I use simple code to test it : mqtt = require('mqtt'); var client = mqtt.connect('mqtt://test.mosquitto.org'); client.on('connect', function () { client.subscribe('presence'); client.publish('presence', 'Hello mqtt'); }); client.on('message', function (topic, message) { // message is Buffer console.log(message.toString()); client.end(); }); But I get an error "Cannot find module 'mqtt'", how can I