Tomas Gotes
Tomas Gotes

Reputation: 31

Protractor SyntaxError: Unexpected token

I am starting to use protractor using eclipse, configured everything, nodejs, protractor, webdriver, but when debugging or if I want to run the test, it always return this Unexpected token

Configuration file:

exports.config = {
  // The address of a running selenium server.
  seleniumAddress: 'http://localhost:4444/wd/hub',

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  // Spec patterns are relative to the configuration file location passed
  // to protractor (in this example conf.js).
  // They may include glob patterns.
  specs: ['example-spec.js'],

  // Options to be passed to Jasmine-node.
  jasmineNodeOpts: {
    showColors: true, // Use colors in the command line report.
  }
};

Error:

C:\Users\tgv\workspace\test7\node_modules\protractor\built\logger.js:75
    info(...msgs) {
         ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\tgv\workspace\test7\node_modules\protractor\built\configParser.js:5:18)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

Upvotes: 3

Views: 2478

Answers (2)

RKM
RKM

Reputation: 47

This was an issue with Node JS built in version in Eclipse. It is may be built with older Node version. I fixed this same issue with below steps.

Installed this Snapshot, http://oss.opensagres.fr/angularjs-eclipse/1.3.0-SNAPSHOT/ 
Run Configurations-> Protractor 
Change Node JS install to be "Native NodeJS"

Upvotes: 0

Peter M
Peter M

Reputation: 546

Have you got the latest version of NodeJS?

I ran into a similar issue which was fixed by updating node

Upvotes: 1

Related Questions