简体   繁体   English

nodejs socket.io 在 ubuntu 18.04 错误运行服务器节点 app.js

[英]nodejs socket.io in ubuntu 18.04 error running server node app.js

I am trying hosting my first node.js socket.io server in ubuntu instance.我正在尝试在 ubuntu 实例中托管我的第一个 node.js socket.io 服务器。 I getting the error on running "node app.js"我在运行“node app.js”时遇到错误

/node_modules/ws/lib/websocket.js:345
      ...options
      ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:53:10)`enter code here`
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)

This error was caused due to installing an old version of Node.JS on your OS.此错误是由于在您的操作系统上安装旧版本的 Node.JS 引起的。

You can try updating to the LTS version.您可以尝试更新到 LTS 版本。 To find out what version your running you can run the command要找出您正在运行的版本,您可以运行命令

node -v

Good Luck!祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM