Page MenuHomePhabricator

`npm run selenium` fails for node 8 and/or npm 5
Closed, InvalidPublic

Description

$ node -v
v8.0.0



$ npm -v
5.0.3



$ npm run selenium

> @ selenium /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki
> killall -0 chromedriver 2>/dev/null || chromedriver --url-base=/wd/hub --port=4444 & grunt webdriver:test; killall chromedriver

Starting ChromeDriver 2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b) on port 4444
Only local connections are allowed.
Running "webdriver:test" (webdriver) task
pattern /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/extensions/*/tests/selenium/specs/**/*.js did not match any file
pattern /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/extensions/VisualEditor/modules/ve-mw/tests/selenium/specs/**/*.js did not match any file
## There is an issue with `node-fibers` ##
`/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/fibers/bin/darwin-x64-57/fibers.node` is missing.

Try running this to fix the issue: /usr/local/Cellar/node/8.0.0_1/bin/node /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/fibers/build
ERROR: Couldn't initialise framework "wdio-mocha-framework".
Error: Missing binary. See message above.
    at Object.<anonymous> (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/fibers/fibers.js:20:8)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/fibers/future.js:2:13)
    at Module._compile (module.js:569:30)

    at Runner.initialiseFramework (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/build/lib/runner.js:561:27)
    at Runner._callee3$ (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/build/lib/runner.js:120:55)
    at tryCatch (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/regenerator-runtime/runtime.js:65:40)
    at Generator.invoke [as _invoke] (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/regenerator-runtime/runtime.js:303:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/regenerator-runtime/runtime.js:117:21)
    at step (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at Promise (<anonymous>)
    at F (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/core-js/library/modules/_export.js:35:28)
    at Runner.<anonymous> (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)
## There is an issue with `node-fibers` ##
`/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/fibers/bin/darwin-x64-57/fibers.node` is missing.

Try running this to fix the issue: /usr/local/Cellar/node/8.0.0_1/bin/node /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/fibers/build
ERROR: Couldn't initialise framework "wdio-mocha-framework".
Error: Missing binary. See message above.
    at Object.<anonymous> (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/fibers/fibers.js:20:8)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/fibers/future.js:2:13)
    at Module._compile (module.js:569:30)

    at Runner.initialiseFramework (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/build/lib/runner.js:561:27)
    at Runner._callee3$ (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/build/lib/runner.js:120:55)
    at tryCatch (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/regenerator-runtime/runtime.js:65:40)
    at Generator.invoke [as _invoke] (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/regenerator-runtime/runtime.js:303:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/regenerator-runtime/runtime.js:117:21)
    at step (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at Promise (<anonymous>)
    at F (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/core-js/library/modules/_export.js:35:28)
    at Runner.<anonymous> (/Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/node_modules/webdriverio/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)
Warning: Task "webdriver:test" failed. Use --force to continue.

Aborted due to warnings.
sh: line 1:  3012 Terminated: 15          chromedriver --url-base=/wd/hub --port=4444

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
zeljkofilipin renamed this task from npm run selenium fails for node 8 and/or npm 5 to `npm run selenium` fails for node 8 and/or npm 5.Jun 6 2017, 3:29 PM

The workaround is to downgrade to node 6.

Mac+homebrew:

$ brew install node@6
...

$ brew unlink node
...

$ brew link --force node@6
...

$ node -v
v6.10.3

$ npm -v
5.0.1
zeljkofilipin lowered the priority of this task from Medium to Low.Jun 6 2017, 3:38 PM

Deleting node_modules folder and running npm install fixed the problem.