# \[W3C\] Encountered internal error running command: Error: Either JSONWP or W3C capabilities sh

**URL:** <https://discuss.appium.io/t/w3c-encountered-internal-error-running-command-error-either-jsonwp-or-w3c-capabilities-sh/38127>\
**Category:** Support\
**Created:** [December 27, 2022, 11:50am UTC](https://discuss.appium.io/t/w3c-encountered-internal-error-running-command-error-either-jsonwp-or-w3c-capabilities-sh/38127 "2022-12-27T11:50:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heorhi\_Boika](https://discuss.appium.io/user_avatar/discuss.appium.io/heorhi_boika/32/10888_2.png) [@Heorhi\_Boika](https://discuss.appium.io/u/Heorhi_Boika)\
**Post date:** [December 27, 2022, 11:50am UTC](https://discuss.appium.io/t/w3c-encountered-internal-error-running-command-error-either-jsonwp-or-w3c-capabilities-sh/38127/1 "2022-12-27T11:50:39Z")

</div>

Hi,  
Can’t launch appium session, get an errors:

1. SyntaxError: Cannot use import statement outside a module
2. Error: Either JSONWP or W3C capabilities should be provided

Can someone help me on how to resolve this?

Appium v1.20.2  
appium-xcuitest-driver v3.62  
WDA v4.9.0  
Node v18.12.1  
Java-client v5.0.0-BETA9  
MacOS Monterey 12.6.2  
Xcode 14.2

Log:  
2022-12-27 12:15:54:939 - [HTTP] --\> POST /wd/hub/session  
2022-12-27 12:15:54:940 - [HTTP] {“desiredCapabilities”:{“noReset”:true,“clearSystemFiles”:true,“useJSONSource”:true,“language”:“en”,“iCloudPassword”:“Qa12345678”,“deviceName”:“Auto126”,“usePrebuiltWDA”:true,“showIOSLog”:false,“iCloudEmail”:“qaimesh@gmail.com”,“showXcodeLog”:true,“newCommandTimeout”:720000,“platformVersion”:“10.0”,“automationName”:“XCUITest”,“wdaStartupRetries”:10,“platformName”:“iOS”,“udid”:“00008101-001508423480001E”,“wdaConnectionTimeout”:“120000”,“app”:"/Users/autoqa/IdeaProjects/automation-framework/Viber\_debug.ipa",“preventWDAAttachments”:“true”,“viberUserName”:“Auto126”,“commandTimeouts”:“60000”,“bundleId”:“com.viber.testing”,“derivedDataPath”:"/Users/autoqa/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu",“launchTimeout”:120000,“wdaLocalPort”:8207,“mjpegServerPort”:1002,“largeScreenSize”:false,“machineUser”:“eliaf”,“phoneNumber”:“0611125126”,“wdaStartupRetryInterval”:2000,“location”:“Israel”},“requiredCapabilities”:{}}  
2022-12-27 12:15:54:941 - [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“noReset”:true,“clearSystemFiles”:true,“useJSONSource”:true,“language”:“en”,“iCloudPassword”:“Qa12345678”,“deviceName”:“Auto126”,“usePrebuiltWDA”:true,“showIOSLog”:false,“iCloudEmail”:“qaimesh@gmail.com”,“showXcodeLog”:true,“newCommandTimeout”:720000,“platformVersion”:“10.0”,“automationName”:“XCUITest”,“wdaStartupRetries”:10,“platformName”:“iOS”,“udid”:“00008101-001508423480001E”,“wdaConnectionTimeout”:“120000”,“app”:"/Users/autoqa/IdeaProjects/automation-framework/Viber\_debug.ipa",“preventWDAAttachments”:“true”,“viberUserName”:“Auto126”,“commandTimeouts”:“60000”,“bundleId”:“com.viber.testing”,“derivedDataPath”:"/Users/autoqa/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu",“launchTimeout”:120000,“wdaLocalPort”:8207,“mjpegServerPort”:1002,“largeScreenSize”:false,“machineUser”:“eliaf”,“phoneNumber”:“0611125126”,“wdaStartupRetryInterval”:2000,“location”:“Israel”},{},null]  
2022-12-27 12:15:54:941 - [debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1672136154941 (12:15:54 GMT+0200 (Israel Standard Time))  
2022-12-27 12:15:54:945 - [debug] [Appium] /usr/local/lib/node\_modules/appium/node\_modules/appium-webdriveragent/index.js:1  
2022-12-27 12:15:54:946 - [debug] [Appium] import \* as dependencies from ‘./lib/check-dependencies’;  
2022-12-27 12:15:54:946 - [debug] [Appium] ^^^^^^  
2022-12-27 12:15:54:946 - [debug] [Appium]  
2022-12-27 12:15:54:946 - [debug] [Appium] SyntaxError: Cannot use import statement outside a module  
2022-12-27 12:15:54:946 - [debug] [Appium] at Object.compileFunction (node:vm:360:18)  
2022-12-27 12:15:54:946 - [debug] [Appium] at wrapSafe (node:internal/modules/cjs/loader:1088:15)  
2022-12-27 12:15:54:946 - [debug] [Appium] at Module.\_compile (node:internal/modules/cjs/loader:1123:27)  
2022-12-27 12:15:54:947 - [debug] [Appium] at Object.Module.\_extensions…js (node:internal/modules/cjs/loader:1213:10)  
2022-12-27 12:15:54:947 - [debug] [Appium] at Module.load (node:internal/modules/cjs/loader:1037:32)  
2022-12-27 12:15:54:947 - [debug] [Appium] at Function.Module.\_load (node:internal/modules/cjs/loader:878:12)  
2022-12-27 12:15:54:947 - [debug] [Appium] at Module.require (node:internal/modules/cjs/loader:1061:19)  
2022-12-27 12:15:54:947 - [debug] [Appium] at require (node:internal/modules/cjs/helpers:103:18)  
2022-12-27 12:15:54:947 - [debug] [Appium] at Object. (/usr/local/lib/node\_modules/appium/node\_modules/appium-xcuitest-driver/lib/driver.js:5:1)  
2022-12-27 12:15:54:947 - [debug] [Appium] at Module.\_compile (node:internal/modules/cjs/loader:1159:14)  
2022-12-27 12:15:54:948 - [debug] [Appium] at Object.Module.\_extensions…js (node:internal/modules/cjs/loader:1213:10)  
2022-12-27 12:15:54:948 - [debug] [Appium] at Module.load (node:internal/modules/cjs/loader:1037:32)  
2022-12-27 12:15:54:948 - [debug] [Appium] at Function.Module.\_load (node:internal/modules/cjs/loader:878:12)  
2022-12-27 12:15:54:949 - [debug] [Appium] at Module.require (node:internal/modules/cjs/loader:1061:19)  
2022-12-27 12:15:54:949 - [debug] [Appium] at require (node:internal/modules/cjs/helpers:103:18)  
2022-12-27 12:15:54:949 - [debug] [Appium] at Object. (/usr/local/lib/node\_modules/appium/node\_modules/appium-xcuitest-driver/index.js:4:1)  
2022-12-27 12:15:54:951 - [debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1672136154950 (12:15:54 GMT+0200 (Israel Standard Time))  
2022-12-27 12:15:54:956 - [debug] [MJSONWP] Encountered internal error running command: Error: Could not load a driver for automationName ‘XCUITest’ and platformName ‘iOS’. Please verify your Appium installation  
2022-12-27 12:15:54:956 - [debug] [MJSONWP] at AppiumDriver.getDriverAndVersionForCaps (/usr/local/lib/node\_modules/appium/lib/appium.js:252:11)  
2022-12-27 12:15:54:957 - [debug] [MJSONWP] at AppiumDriver.createSession (/usr/local/lib/node\_modules/appium/lib/appium.js:324:66)  
2022-12-27 12:15:54:957 - [debug] [MJSONWP] at commandExecutor (/usr/local/lib/node\_modules/appium/node\_modules/appium-base-driver/lib/basedriver/driver.js:334:9)  
2022-12-27 12:15:54:958 - [debug] [MJSONWP] at AppiumDriver.executeCommand (/usr/local/lib/node\_modules/appium/node\_modules/appium-base-driver/lib/basedriver/driver.js:348:15)  
2022-12-27 12:15:54:958 - [debug] [MJSONWP] at AppiumDriver.executeCommand (/usr/local/lib/node\_modules/appium/lib/appium.js:533:26)  
2022-12-27 12:15:54:958 - [debug] [MJSONWP] at asyncHandler (/usr/local/lib/node\_modules/appium/node\_modules/appium-base-driver/lib/protocol/protocol.js:297:34)  
2022-12-27 12:15:54:958 - [debug] [MJSONWP] at /usr/local/lib/node\_modules/appium/node\_modules/appium-base-driver/lib/protocol/protocol.js:423:15  
2022-12-27 12:15:54:958 - [debug] [MJSONWP] at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/layer.js:95:5)  
2022-12-27 12:15:54:958 - [debug] [MJSONWP] at next (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/route.js:144:13)  
2022-12-27 12:15:54:958 - [debug] [MJSONWP] at Route.dispatch (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/route.js:114:3)  
2022-12-27 12:15:54:959 - [debug] [MJSONWP] at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/layer.js:95:5)  
2022-12-27 12:15:54:959 - [debug] [MJSONWP] at /usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/index.js:284:15  
2022-12-27 12:15:54:959 - [debug] [MJSONWP] at Function.process\_params (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/index.js:346:12)  
2022-12-27 12:15:54:959 - [debug] [MJSONWP] at next (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/index.js:280:10)  
2022-12-27 12:15:54:959 - [debug] [MJSONWP] at logger (/usr/local/lib/node\_modules/appium/node\_modules/morgan/index.js:144:5)  
2022-12-27 12:15:54:959 - [debug] [MJSONWP] at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/layer.js:95:5)  
2022-12-27 12:15:54:963 - [HTTP] \<-- POST /wd/hub/session 500 21 ms - 253  
2022-12-27 12:15:54:964 - [HTTP]  
2022-12-27 12:15:54:966 - [HTTP] --\> POST /wd/hub/session  
2022-12-27 12:15:54:967 - [HTTP] {“capabilities”:[{“desiredCapabilities”:{“noReset”:true,“clearSystemFiles”:true,“useJSONSource”:true,“language”:“en”,“iCloudPassword”:“Qa12345678”,“deviceName”:“Auto126”,“usePrebuiltWDA”:true,“showIOSLog”:false,“iCloudEmail”:“qaimesh@gmail.com”,“showXcodeLog”:true,“newCommandTimeout”:720000,“platformVersion”:“10.0”,“automationName”:“XCUITest”,“wdaStartupRetries”:10,“platformName”:“iOS”,“udid”:“00008101-001508423480001E”,“wdaConnectionTimeout”:“120000”,“app”:"/Users/autoqa/IdeaProjects/automation-framework/Viber\_debug.ipa",“preventWDAAttachments”:“true”,“viberUserName”:“Auto126”,“commandTimeouts”:“60000”,“bundleId”:“com.viber.testing”,“derivedDataPath”:"/Users/autoqa/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu",“launchTimeout”:120000,“wdaLocalPort”:8207,“mjpegServerPort”:1002,“largeScreenSize”:false,“machineUser”:“eliaf”,“phoneNumber”:“0611125126”,“wdaStartupRetryInterval”:2000,“location”:“Israel”}},{“requiredCapabilities”:{}}]}  
2022-12-27 12:15:54:973 - [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [null,null,[{“desiredCapabilities”:{“noReset”:true,“clearSystemFiles”:true,“useJSONSource”:true,“language”:“en”,“iCloudPassword”:“Qa12345678”,“deviceName”:“Auto126”,“usePrebuiltWDA”:true,“showIOSLog”:false,“iCloudEmail”:“qaimesh@gmail.com”,“showXcodeLog”:true,“newCommandTimeout”:720000,“platformVersion”:“10.0”,“automationName”:“XCUITest”,“wdaStartupRetries”:10,“platformName”:“iOS”,“udid”:“00008101-001508423480001E”,“wdaConnectionTimeout”:“120000”,“app”:"/Users/autoqa/IdeaProjects/automation-framework/Viber\_debug.ipa",“preventWDAAttachments”:“true”,“viberUserName”:“Auto126”,“commandTimeouts”:“60000”,“bundleId”:“com.viber.testing”,“derivedDataPath”:"/Users/autoqa/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu",“launchTimeout”:120000,“wdaLocalPort”:8207,“mjpegServerPort”:1002,“largeScreenSize”:false,“machineUser”:“eliaf”,“phoneNumber”:“0611125126”,“wdaStartupRetryInterval”:2000,“location”:“Israel”}},{“requiredCapabilities”:{}}]]  
2022-12-27 12:15:54:973 - [debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1672136154973 (12:15:54 GMT+0200 (Israel Standard Time))  
2022-12-27 12:15:54:998 - [debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1672136154998 (12:15:54 GMT+0200 (Israel Standard Time))  
2022-12-27 12:15:55:001 - [debug] [W3C] Encountered internal error running command: Error: Either JSONWP or W3C capabilities should be provided  
2022-12-27 12:15:55:001 - [debug] [W3C] at parseCapsForInnerDriver (/usr/local/lib/node\_modules/appium/lib/utils.js:58:14)  
2022-12-27 12:15:55:001 - [debug] [W3C] at AppiumDriver.createSession (/usr/local/lib/node\_modules/appium/lib/appium.js:309:26)  
2022-12-27 12:15:55:001 - [debug] [W3C] at commandExecutor (/usr/local/lib/node\_modules/appium/node\_modules/appium-base-driver/lib/basedriver/driver.js:334:9)  
2022-12-27 12:15:55:002 - [debug] [W3C] at AppiumDriver.executeCommand (/usr/local/lib/node\_modules/appium/node\_modules/appium-base-driver/lib/basedriver/driver.js:348:15)  
2022-12-27 12:15:55:002 - [debug] [W3C] at AppiumDriver.executeCommand (/usr/local/lib/node\_modules/appium/lib/appium.js:533:26)  
2022-12-27 12:15:55:002 - [debug] [W3C] at asyncHandler (/usr/local/lib/node\_modules/appium/node\_modules/appium-base-driver/lib/protocol/protocol.js:297:34)  
2022-12-27 12:15:55:003 - [debug] [W3C] at /usr/local/lib/node\_modules/appium/node\_modules/appium-base-driver/lib/protocol/protocol.js:423:15  
2022-12-27 12:15:55:003 - [debug] [W3C] at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/layer.js:95:5)  
2022-12-27 12:15:55:003 - [debug] [W3C] at next (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/route.js:144:13)  
2022-12-27 12:15:55:003 - [debug] [W3C] at Route.dispatch (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/route.js:114:3)  
2022-12-27 12:15:55:003 - [debug] [W3C] at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/layer.js:95:5)  
2022-12-27 12:15:55:003 - [debug] [W3C] at /usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/index.js:284:15  
2022-12-27 12:15:55:003 - [debug] [W3C] at Function.process\_params (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/index.js:346:12)  
2022-12-27 12:15:55:003 - [debug] [W3C] at next (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/index.js:280:10)  
2022-12-27 12:15:55:004 - [debug] [W3C] at logger (/usr/local/lib/node\_modules/appium/node\_modules/morgan/index.js:144:5)  
2022-12-27 12:15:55:004 - [debug] [W3C] at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/appium/node\_modules/express/lib/router/layer.js:95:5)

---

<div class="post-metadata">

**Author:** ![MohammedAfroz](https://discuss.appium.io/user_avatar/discuss.appium.io/mohammedafroz/32/10912_2.png) [@MohammedAfroz](https://discuss.appium.io/u/MohammedAfroz)\
**Post date:** [January 2, 2023, 10:52am UTC](https://discuss.appium.io/t/w3c-encountered-internal-error-running-command-error-either-jsonwp-or-w3c-capabilities-sh/38127/2 "2023-01-02T10:52:04Z")

</div>

I have the same Error

Please suggest solution

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [January 2, 2023, 6:24pm UTC](https://discuss.appium.io/t/w3c-encountered-internal-error-running-command-error-either-jsonwp-or-w3c-capabilities-sh/38127/3 "2023-01-02T18:24:41Z")

</div>

> [@Heorhi\_Boika](#):
>
> Xcode 14.2

> [@MohammedAfroz](#):
>
> I have the same Error

Use Appium 2 with Xcode 14.

> **[Installing Appium 2.0 and the Driver and Plugins CLI](https://www.headspin.io/blog/installing-appium-2-0-and-the-driver-and-plugins-cli)**
>
> This blog walks us through the key goals of Appium 2.0 and the methodology of installing Appium 2.0, Appium drivers, and the other driver CLI commands

---

<div class="post-metadata">

**Author:** ![MohammedAfroz](https://discuss.appium.io/user_avatar/discuss.appium.io/mohammedafroz/32/10912_2.png) [@MohammedAfroz](https://discuss.appium.io/u/MohammedAfroz)\
**Post date:** [January 3, 2023, 7:04am UTC](https://discuss.appium.io/t/w3c-encountered-internal-error-running-command-error-either-jsonwp-or-w3c-capabilities-sh/38127/4 "2023-01-03T07:04:03Z")

</div>

Thank you Very Much Wreed  
working on Appium2 now and configured WDA in Xcode as Well and Installed Integration app on real device.  
But I got another Error now with appium 2  
Please i need Your help with this…

log file  
✔ Checking if driver ‘xcuitest’ is updatable  
✖ Checking if driver ‘xcuitest’ needs an update  
✔ Checking if driver ‘uiautomator2’ is updatable  
✖ Checking if driver ‘uiautomator2’ needs an update  
ℹ Update report:  
ℹ - ‘xcuitest’ had no updates available  
ℹ - ‘uiautomator2’ had no updates available

-MacBook-Pro ~ % appium  
[Appium] Welcome to Appium v2.0.0-beta.48  
[Appium] Attempting to load driver xcuitest…  
[debug] [Appium] Requiring driver at /Users/findia12/.appium/node\_modules/appium-xcuitest-driver  
[Appium] Could not load driver ‘xcuitest’, so it will not be available. Error in loading the driver was: Cannot find module ‘./capabilities’

 ![42%20PM](https://discuss.appium.io/uploads/default/original/2X/6/6e46e4192eb3841bb5bb607618cf2a41587acb85.png) Screenshot 2023-01-03 at 12.31.42 PM

---

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [January 3, 2023, 4:44pm UTC](https://discuss.appium.io/t/w3c-encountered-internal-error-running-command-error-either-jsonwp-or-w3c-capabilities-sh/38127/5 "2023-01-03T16:44:10Z")

</div>

You haven’t given enough information. This looks like some kind of GUI error. Maybe try to ask a better question:

[https://stackoverflow.com/help/how-to-ask](https://stackoverflow.com/help/how-to-ask)

---

<div class="post-metadata">

**Author:** ![MohammedAfroz](https://discuss.appium.io/user_avatar/discuss.appium.io/mohammedafroz/32/10912_2.png) [@MohammedAfroz](https://discuss.appium.io/u/MohammedAfroz)\
**Post date:** [January 4, 2023, 6:14am UTC](https://discuss.appium.io/t/w3c-encountered-internal-error-running-command-error-either-jsonwp-or-w3c-capabilities-sh/38127/6 "2023-01-04T06:14:09Z")

</div>

Thank You @wreed , Appium is working fine now.
