Protractor 量角器语法错误:意外标记

Protractor 量角器语法错误:意外标记,protractor,Protractor,我开始使用eclipse的量角器,配置了一切,nodejs,量角器,webdriver,但是当调试或者如果我想运行测试时,它总是返回这个意外的令牌 配置文件: exports.config = { // The address of a running selenium server. seleniumAddress: 'http://localhost:4444/wd/hub', // Capabilities to be passed to the webdriver inst

我开始使用eclipse的量角器,配置了一切,nodejs,量角器,webdriver,但是当调试或者如果我想运行测试时,它总是返回这个意外的令牌

配置文件:

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.
  }
};
错误:

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)
C:\Users\tgv\workspace\test7\node\u modules\dragrator\builded\logger.js:75
信息(…msgs){
^^^
SyntaxError:意外标记。。。
在exports.runInThisContext(vm.js:53:16)
在模块处编译(Module.js:414:25)
在Object.Module.\u extensions..js(Module.js:442:10)
在Module.load(Module.js:356:32)
在Function.Module.\u加载(Module.js:313:12)
at Module.require(Module.js:366:17)
根据需要(module.js:385:17)
在对象上。(C:\Users\tgv\workspace\test7\node\u modules\dragrator\builded\configParser.js:5:18)
在模块处编译(Module.js:435:26)
在Object.Module.\u extensions..js(Module.js:442:10)

您有最新版本的NodeJS吗


我遇到了一个类似的问题,通过更新节点解决了这个问题。这是Eclipse中node JS内置版本的问题。它可能是使用较旧的节点版本构建的。我通过以下步骤解决了相同的问题

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

这里也一样。我在我的Eclipse项目中使用npm安装了量角器。我猜它是最新版本。