Skip to content Skip to sidebar Skip to footer

Unexpected Token Illegal Using Node Javascript

I am trying to execute a command using node JavaScript, but I am getting 'Uncaught SyntaxError: Unexpected token ILLEGAL' in my javascript.Its on line 1. NB: mongo_host is the Git

Solution 1:

Your semicolons aren't standard semicolons. They are \u037e (Greek Question Mark). Try switching them back to standard semicolons and then running the code.

Someone has been reading twitter.

Solution 2:

As @dvlsg said, it's a syntax error which caused by some illegal symbols like .

There was a similiar SO thread which be helpful for you, please see No visible cause for "Unexpected token ILLEGAL".

Solution 3:

I solved this error by updating my node version in the Azure web app service to the latest (10.6.0 in my case). It had been balking at the lines containing ES6. One way to change that is with an environment variable. You can change it in 'Application settings' in your app's portal. Change WEBSITE_NODE_DEFAULT_VERSION

Post a Comment for "Unexpected Token Illegal Using Node Javascript"