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

Meteor Error: Unexpected token: const { pause } = require("./debug.js"); #9275

Closed
zxweed opened this issue Dec 28, 2017 · 5 comments
Closed

Comments

@zxweed
Copy link

zxweed commented Dec 28, 2017

Description:

Server Setup Information:

  • Version of Rocket.Chat Server: 0.60.1
  • Operating System: Ubuntu
  • Deployment Method(snap/docker/tar/etc): tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: none
  • Node Version: 4.8.4

Steps to Reproduce:

node main.js

/opt/Rocket.Chat/programs/server/boot.js:50
const { pause } = require("./debug.js");
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/opt/Rocket.Chat/main.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

@TwizzyDizzy
Copy link

TwizzyDizzy commented Dec 28, 2017

This is probably due to the upgrade to nodejs8 (mentioned in the release blog post). So you first need to upgrade to nodejs8 before running >= 0.60.x.

So this issue is probably obsolete and you can close it, as soon as you have verified that it works with nodejs8 (which will most probably be the case).

Cheers
Thomas

@therealgill
Copy link

therealgill commented Jan 2, 2018

I have the same issue. Though, I have upgraded to NodeJS 8.9.3.

root@chat:/Rocket.Chat# node -v
v4.8.4
root@chat:/Rocket.Chat# nodejs -v
v8.9.3
root@chat:/Rocket.Chat# npm -v
5.5.1
root@chat:/Rocket.Chat# ls
main.js  programs  README  server  star.json
root@chat:/Rocket.Chat# node main.js
/Rocket.Chat-old/programs/server/boot.js:50
    const { pause } = require("./debug.js");
          ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Rocket.Chat-old/main.js:4:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

@TwizzyDizzy
Copy link

@therealgill Are you sure your RC instance is started with the command nodejs (which would indeed be version 8.9.3 in your case)? My hunch is, that you still start RC with the node command... leading to this error that - as mentioned above - is caused by running RC with node versions < 8.

In usual setups, the output of node -v vs. the output of nodejs -v should return the same result.

Cheers
Thomas

@therealgill
Copy link

therealgill commented Jan 2, 2018

Right you are! The startup script was calling node instead of nodejs. One simple change and the server is back up. Thank @TwizzyDizzy

Edit:

The Node version being 4.8.4 was a result of the installation documentation: https://rocket.chat/docs/installation/manual-installation/ubuntu/ .

Specifically, the command: sudo n 4.8.4

@geekgonecrazy
Copy link
Contributor

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

4 participants