5

Mac OSX version: Catalina 10.15.7
Node version: 10.18.1
NPM version: 6.13.4
Protractor version: 5.4.2
Chrome driver version: 87.0.4280.88
Chrome browser version: 87.0.4280.141 (Official Build) (x86_64)

I suddenly ran into a problem whilst running some protractor tests directly against my local Chrome browser. I encountered the following error when running ng e2e --devServerTarget=:

[12:33:36] I/launcher - Running 1 instances of WebDriver
[12:33:36] I/direct - Using ChromeDriver directly...
[12:33:36] E/launcher - spawn Unknown system error -86
[12:33:36] E/launcher - Error: spawn Unknown system error -86
    at ChildProcess.spawn (internal/child_process.js:366:11)
    at Object.spawn (child_process.js:551:9)
    at exec (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/selenium-webdriver/io/exec.js:116:27)
    at resolveCommandLineFlags.then.args (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/selenium-webdriver/remote/index.js:219:25)
    at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebDriver.createSession()
    at Function.createSession (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/selenium-webdriver/chrome.js:761:15)
    at Direct.getNewDriver (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/protractor/built/driverProviders/direct.js:77:33)
    at Runner.createBrowser (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/protractor/built/runner.js:195:43)
    at q.then.then (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/protractor/built/runner.js:339:29)
    at _fulfilled (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/q/q.js:834:54)
    at /Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/q/q.js:863:30
    at Promise.promise.promiseDispatch (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/q/q.js:796:13)
    at /Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/q/q.js:556:49
    at runSingle (/Users/jonathanst@kainos.com/dev/code/cpp.idam.am.idam-frontend/node_modules/q/q.js:137:13)
[12:33:36] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! idam-frontend@1.0.0 docker:e2e: `IDAM_TEST_ENV=docker ng e2e --devServerTarget=`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the idam-frontend@1.0.0 docker:e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jonathanst@kainos.com/.npm/_logs/2021-01-08T12_33_36_195Z-debug.log
make: *** [docker-e2e] Error 1

I had not made any changes to my protractor/chrome-driver configuration. It just suddenly started failing. I have tried clean builds, reverting my changes but I am still having this problem. Please can anyone help?

Johno
  • 162
  • 1
  • 14
  • could yopu try updating protractor ? – PDHide Jan 08 '21 at 16:40
  • also add some code , spec file , config file etc – PDHide Jan 08 '21 at 16:41
  • I tried protractor versions 5.4.0 - 5.4.4 and version 7.0.0, same issue occurs – Johno Jan 08 '21 at 17:16
  • I am facing same issue, please let me know if you find the solution – MJ_iOSDev Jan 09 '21 at 06:49
  • 2
    I have started noticing the exact same issue since today. My environment details are similar i.e. macOS 10.15.7 and getting following error: >ng e2e [20:16:52] I/launcher - Running 1 instances of WebDriver [20:16:52] I/direct - Using ChromeDriver directly... [20:16:52] E/launcher - spawn Unknown system error -86 [20:16:52] E/launcher - Error: spawn Unknown system error -86 at ChildProcess.spawn (internal/child_process.js:403:11) at Object.spawn (child_process.js:553:9) at exec (/Users/ashish/MyProj/node_modules/selenium-webdriver/io/exec.js:116:27) – kcak11 Jan 11 '21 at 14:48
  • I followed the answer here and it fixed my issue: https://stackoverflow.com/a/65633535/218432 – kcak11 Jan 11 '21 at 14:58
  • Follow the solution here: https://stackoverflow.com/questions/65618558/osx-fix-selenium-chromedriver-launch-error-spawn-unknown-system-error-86-bad-cp/65633535#65633535 That should fix the issue. – kcak11 Jan 11 '21 at 15:06

1 Answers1

5

I encounter the same error this morning and found that the fix was to run:
webdriver-manager update
npm install --force protractor
There was a fix to this issue in the latest webddriver-manager update. You'll need to force a dependency update on protractor for it to use the latest webdriver-manager

Alessandro Kreslin
  • 269
  • 1
  • 3
  • 15
  • I don't have webdrive-manager installed globally ... I did ... npm install -g webdriver-manager ... and then ran your commands ... no joy :( – danday74 Apr 14 '21 at 09:00
  • Subsequently I tried adding this entry to scripts in package.json ... "webdriver-manager": "webdriver-manager" ... and then running your commands, still no joy :( – danday74 Apr 14 '21 at 09:12
  • Do you have protractor installed globally? ```npm install protractor -g``` – Alessandro Kreslin Apr 14 '21 at 22:08