[英]getting this error when i run the code to send message through Nexmo. message is sent but after that this error occurs
未捕获的异常回调不是函数{“ stack”:“ TypeError:回调不是回调函数(/home/akkastech/backend-api/node_modules/nexmo/src/index.js:171:23)\\n HttpClient.callback [as __parseResponse](/home/akkastech/backend-api/node_modules/nexmo/src/HttpClient.js:181:7)\\n在IncomingMessage .__ parseResponse(/ home / akkastech / backend-api / node_modules / nexmo /src/HttpClient.js:93:16)\\n在emitNone(events.js:111:20)\\ n在IncomingMessage.emit(events.js:208:7)\\ n在endReadableNT(_stream_read.js:1055: 12)\\ n在_combinedTickCallback(内部/进程/next_tick.js:138:11)\\n在process._tickCallback(内部/process/next_tick.js:180:9)“}
it looks like you're passing something as a callback parameter that's not actually a function. 看起来您正在传递某些东西作为实际上不是函数的回调参数。 It should look like this:
它看起来应该像这样:
nexmo.message.sendSms(from, to, text, (err, responseData) => {
if (err) {
console.log(err);
} else {
if(responseData.messages[0]['status'] === "0") {
console.log("Message sent successfully.");
} else {
console.log(`Message failed with error: ${responseData.messages[0]['error-text']}`);
}
}
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.