无法运行webdriver manager

时间:2017-01-23 12:49:16

标签: node.js selenium gulp protractor webdriver-manager

当我跑步时

  
    

vegan @ vegan:〜/ xx-xx / gateway $ webdriver-manager start /usr/lib/node_modules/protractor/node_modules/webdriver-manager/built/lib/cli/logger.js:66         info(... msgs){              ^^^

  
     

SyntaxError:意外的令牌......       在exports.runInThisContext(vm.js:53:16)       在Module._compile(module.js:387:25)       在Object.Module._extensions..js(module.js:422:10)       在Module.load(module.js:357:32)       在Function.Module._load(module.js:314:12)       在Module.require(module.js:367:17)       at require(internal / module.js:20:19)       在对象。 (/usr/lib/node_modules/protractor/node_modules/webdriver-manager/built/lib/cli/index.js:8:10)       在Module._compile(module.js:413:34)       在Object.Module._extensions..js(module.js:422:10)

我收到了错误。它是在量角器不运行时开始的。

错误是

Protractor error selenium spring boot

但是这次更新版本,没有用。所以我在删除节点模块文件后执行了npm install,bower gulp install。

现在为了gulp run(我用gulp来运行量角器),我得到了这个

> gulp protractor prod [15:47:58] Using gulpfile
> ~/xx-xx/gateway/gulpfile.js [15:47:58] Starting 'protractor'...
> [15:47:58] Starting 'prod'... [15:47:58] Finished 'prod' after 547 μs
> Using ChromeDriver directly... [launcher] Running 1 instances of
> WebDriver [launcher] Error: SyntaxError: Unexpected token ...
>     at exports.runInThisContext (vm.js:53:16)
>     at Module._compile (module.js:387:25)
>     at Object.Module._extensions..js (module.js:422:10)
>     at Module.load (module.js:357:32)
>     at Function.Module._load (module.js:314:12)
>     at Module.require (module.js:367:17)
>     at require (internal/module.js:20:19)
>     at Object.<anonymous> (/home/vegan/xx-xx/gateway/node_modules/jasminewd2/index.js:7:17)
>     at Module._compile (module.js:413:34)
>     at Object.Module._extensions..js (module.js:422:10) [launcher] Process exited with error code 100 [15:47:59] gulp-notify: [JHipster
> Gulp Build] Error: protractor exited with code 100 [15:47:59] Finished
> 'protractor' after 1.19 s [15:47:59] E2E Tests failed

更新

我删除了所有节点模块并再次安装了npm。现在当我这样做 ** webdriver-manager 它会出错 **

webdriver-manager 
/usr/lib/node_modules/protractor/node_modules/webdriver-manager/built/lib/cli/logger.js:66
    info(...msgs) {
         ^^^
SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/protractor/node_modules/webdriver-manager/built/lib/cli/index.js:8:10)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)**

**

或** webdriver-manager更新 **相同

1 个答案:

答案 0 :(得分:3)

这是因为您使用的是旧版本的节点。请将您的节点版本更新为min。 6.9.x并尝试它肯定会有效。