Vue-cli: SyntaxError: Invalid or unexpected token (express)

Created on 17 Nov 2016  ·  5Comments  ·  Source: vuejs/vue-cli

How to solve this error??

vagrant@med:~/modal.dev$ npm run dev
> [email protected] 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! [email protected] dev: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

Most helpful comment

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:

All 5 comments

Hello,
I just started learning nodejs.
I installed node js and tried to run a simple hello world program. I am getting this error which appears in the screenshot. Please help me resolve. Thanks.

screen shot 2017-02-15 at 7 01 35 pm

i have this problem too :(

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:

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

Change the encoding of your file (UTF-8 )

Don't make file by out-file command,, make file by new-item command from windows shell.

Was this page helpful?
0 / 5 - 0 ratings