【发布时间】:2019-10-11 17:10:32
【问题描述】:
我正在尝试通过完全按照此视频设置群发文本:https://www.youtube.com/watch?v=EMOYY58jyKk
尝试运行时收到此错误:
SyntaxError: Unexpected token :
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/Users/wesleymoore/Downloads/Twilio Passthrough
Friday/node_modules/node-env-run/dist/bin/node-env-run.js:21:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! passthrough@1.0.0 start: `nodenv .`
npm ERR! Exit status 1
我已经设法使用更简单的代码来发送一封电子邮件,但我需要发送大量电子邮件。我的日志中没有收到任何内容,所以我不确定问题可能是什么。任何帮助将不胜感激。或者如果可能的话,我可以使用此代码添加额外的数字,因为它似乎有效:
var accountSid = '------------'; // Your Account SID from
www.twilio.com/console
var authToken = '---------------'; // Your Auth Token from
www.twilio.com/console
var twilio = require('twilio');
var client = new twilio(accountSid, authToken);
client.messages.create({
body: 'Hello from Node',
to: '+1usnumber', // Text this number
from: '+1usnumber' // From a valid Twilio number
})
.then((message) => console.log(message.sid));
【问题讨论】:
-
你能分享你正在运行的导致该错误的代码吗?