question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: Invalid or unexpected token (express)

See original GitHub issue

How to solve this error??

vagrant@med:~/modal.dev$ npm run dev
> modaljs@1.0.0 dev /home/vagrant/modal.dev
> node build/dev-server.js

/home/vagrant/modal.dev/node_modules/express/lib/application.js:370
  return

SyntaxError: Invalid or unexpected token
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/vagrant/modal.dev/node_modules/express/lib/express.js:17:13)
    at Module._compile (module.js:570:32)

npm ERR! Linux 3.2.0-23-generic-pae
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! modaljs@1.0.0 dev: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the modaljs@1.0.0 dev script 'node build/dev-server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the modaljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs modaljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls modaljs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/modal.dev/npm-debug.log

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
pwichmanncommented, Nov 17, 2017

Arrived here by accident. I think you copied code from the MacOS Notes and your quotes were transformed into weird quotes instead of the only two allowed types:

  • "

What you have is:

1reaction
jamsheedpkcommented, Feb 1, 2019

Issue Fixed screenshot from 2019-02-01 16-15-12

Change the encoding of your file (UTF-8 )

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nodejs SyntaxError: Invalid or unexpected - Stack Overflow
OK. I found the solution to this issue. The thing is that I created the index.js file in my project using PowerShell's Out-File...
Read more >
Have a JavaScript Unexpected Token Error? Check Your Syntax
The Unexpected Token error is a specific type of SyntaxError object. Why Does an Unexpected Token Occur? JavaScript is particular about the way ......
Read more >
Nodejs Uncaught SyntaxError: Unexpected token import
An unexpected token import occurs when an error message appears in the console while running a web application.
Read more >
JavaScript SyntaxError: Invalid or unexpected token ... - IBM
I have an urgent problem with client side human service which runs in a rendering javascript issue. I am on v8.5.7 - no...
Read more >
SyntaxError: Unexpected token import in Node.js | bobbyhadz
The "SyntaxError: Unexpected token import" occurs when we use the ES6 import syntax in a version of Node that doesn't support it. To...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found