Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token ... #2

Open
coneheadusa opened this issue Aug 9, 2018 · 2 comments
Open

Unexpected token ... #2

coneheadusa opened this issue Aug 9, 2018 · 2 comments

Comments

@coneheadusa
Copy link

After cloning your project, successfully running' npm install', I get the following errors when I execute 'npm run server':
`

websocket-chat@0.0.0 server /var/www/html/srptApp/websocket-chat
node ./server/server.js
/var/www/html/srptApp/websocket-chat/server/handlers.js:37
const entry = { user, ...createEntry() }
---------------------^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/var/www/html/srptApp/websocket-chat/server/server.js:6:22)
npm ERR! Linux 3.10.0-862.3.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "server"
npm ERR! node v6.14.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! websocket-chat@0.0.0 server: node ./server/server.js
npm ERR! Exit status 1
npm ERR!
`

Please advise.

@justadudewhohacks
Copy link
Owner

Hi,

Node 6 doesn't know about the object-rest-spread operator "...". You can either upgrade node to a recent version or use babel to transpile the code if you have to use node 6.

@littledivy
Copy link

@coneheadusa Consider updating your Nodejs and It will work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants