browserstack / webdriverio-browserstack

Selenium examples for WebDriverIO and BrowserStack Automate
https://www.browserstack.com
68 stars 93 forks source link

npm run local doesn't work for me #59

Closed ApplefaceLisa closed 1 year ago

ApplefaceLisa commented 1 year ago

I can't get npm run local works for me. Here's more info for debugging.

  1. download repo zip file and unzip
  2. npm install
  3. set my user and key export BROWSERSTACK_USERNAME= && export BROWSERSTACK_ACCESS_KEY=
  4. npm run local In console, I saw the following:
    
    > webdriverio-browserstack@1.0.1 local
    > npx wdio conf/local-test.conf.js

Execution of 1 workers started at 2023-05-31T23:23:47.387Z

/webdriverio-browserstack-master/node_modules/browserstack-local/lib/Local.js:112 callback(new LocalError(data['message']['message'])); ^

TypeError: Cannot read properties of undefined (reading 'message') at webdriverio-browserstack-master/node_modules/browserstack-local/lib/Local.js:112:50 at ChildProcess.exithandler (node:child_process:394:7) at ChildProcess.emit (node:events:513:28) at ChildProcess.emit (node:domain:489:12) at maybeClose (node:internal/child_process:1100:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

The local.log file contains the following message:

Wed May 31 2023 17:22:09:391 GMT-0700 (PDT) -- [WARNING] Discovered proxy settings in your environment. Use the --pac-file argument to specify the absolute path to your PAC file. For more proxy options, refer to the Local Testing documentation (https://www.browserstack.com/local-testing/binary-params).

Wed May 31 2023 17:22:09:392 GMT-0700 (PDT) -- You can disable this warning by using the --disable-proxy-discovery argument while using the Local binary.

Wed May 31 2023 17:22:10:131 GMT-0700 (PDT) -- Received runtime exception: Error: listen EADDRINUSE: address already in use 127.0.0.1:45454 at Server.setupListenHandle [as _listen2] (net.js:1280:14) at listenInCluster (net.js:1328:12) at doListen (net.js:1461:7) at process._tickCallback (internal/process/next_tick.js:63:19) Wed May 31 2023 17:22:10:133 GMT-0700 (PDT) -- Exiting. Wed May 31 2023 17:22:10:139 GMT-0700 (PDT) -- Received runtime exception: Error: listen EADDRINUSE: address already in use 127.0.0.1:45954 at Server.setupListenHandle [as _listen2] (net.js:1280:14) at listenInCluster (net.js:1328:12) at doListen (net.js:1461:7) at process._tickCallback (internal/process/next_tick.js:63:19) Wed May 31 2023 17:22:10:139 GMT-0700 (PDT) -- Exiting.

ApplefaceLisa commented 1 year ago

Problem root cause found and solved. Close this.