Error with Unexpected token?

0

I have a project on my machine that uses node.js. It runs smoothly, but when I pass it to my server on c9.io (Linux) it is giving this error:

user:~/workspace/guidebot (master) $ node index.js

/home/ubuntu/workspace/guidebot/index.js:44
  const init = async() => {
                    ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    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.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)

Given that the index file on line 44 is:

const init = async() => {        //Linha 44

  // Here we load **commands** into memory, as a collection, so they're accessible
  // here and everywhere else.
  const cmdFiles = await readdir("./commands/");
  client.logger.log('Loading a total of ${cmdFiles.length} commands.');
  cmdFiles.forEach(f => {
    if (!f.endsWith(".js")) return;
    const response = client.loadCommand(f);
    if (response) console.log(response);
  });

The version of the node that I am using on the pc is v8.9.4, and the server version is: v6.11.2 Is that the problem? How do I update the server node?

    
asked by anonymous 19.01.2018 / 17:48

0 answers