twilio / twilio-node

Node.js helper library
MIT License
1.37k stars 495 forks source link

Getting a SyntaxError: Unexpected token . , It works on local system, but does'nt work on server #940

Closed ajithv11 closed 1 year ago

ajithv11 commented 1 year ago

Hi,

Getting a SyntaxError: Unexpected token . , It works on local system, but does'nt work on server, Unfortunately I don't have much details to share here, I got only the line of code where the error happens

/var/www/server/node_modules/twilio/lib/rest/Twilio.js:34
if (this.opts?.lazyLoading === false) {

My nodejs version on server is v10.19.0 Does this cause the issue?

By the way my local nodejs version is v12.22.9

shrutiburman commented 1 year ago

Hi @ajithv11, Yes, please try upgrading to Node v12. It'd be great to upgrade to Node v14+ (as these are the officially supported node versions). Thanks

ajithv11 commented 1 year ago

@shrutiburman Fixed the issue by upgrading Nodejs version on the server

shrutiburman commented 1 year ago

That's great. Closing this issue then. Please feel free to open a new one in case any issue occurs. Thanks!