Could not launch the iOS app due to Error: spawn appium --base-path /wd/hub ENOENT


I am trying to launch the iOS demo app on visual studio with wdio always getting below error.

Error on terminal –

appium Version - 2.4.1
appium-doctor version - 1.16.2
node version - v20.11.0

config.capabilities = [
// The defaults you need to have in your config
platformName: ‘ios’,
maxInstances: 1,
‘appium:deviceName’: ‘iPhone 15 Pro’,
‘appium:platformVersion’: ‘17.0’,
‘appium:automationName’: ‘XCUITest’,
“appium:udid”: ‘C4002DAF-B1E6-4EF8-98CC-4636A732EDE6’,
// The path to the app
‘appium:app’: join(process.cwd(), ‘apps/’),
// @ts-ignore
‘appium:bundleId’: ‘org.reactjs.native.example.wdiodemoapp’,
‘appium:xcodeOrgId’:‘Alekhya Mamilla (Personal Team)’,
‘appium:xcodeSigningId’:‘Apple Development’,
‘appium:noReset’: true,
‘appium:newCommandTimeout’: 240,
}, = ( ? : []).concat([
// This will use the globally installed version of Appium
command: ‘appium --base-path /wd/hub’,
path : ‘/’,
args: {
// This is needed to tell Appium that we can execute local ADB commands
// and to automatically download the latest version of ChromeDriver
relaxedSecurity: true,
// =====================
// Server Configurations
// =====================
config.port = 4723;

Package.json –

two times base-path?

Was a quick fix. Thanks for that @Aleksei.

I am seeing one more issue also. Can you help me on the same. im using the same one as above

alekhya.m.mamilla@AMAC02FC9DHMD6N typescript_playwright_appium-master_6Feb % npm run wdio_ios

wdio config/wdio.ios.conf.ts

2024-02-06T14:27:11.601Z ERROR @wdio/config:ConfigParser: Failed loading configuration file: /Users/alekhya.m.mamilla/Documents/MTN/typescript_playwright_appium-master_6Feb/config/wdio.ios.conf.ts: Cannot use import statement outside a module
wdio [command]

The wdio command allows you run and manage your WebdriverIO test suite.
If no command is provided it calls the run command by default, so:

$ wdio wdio.conf.js

is the same as:
$ wdio run wdio.conf.js

For more information, visit:

wdio config Initialize WebdriverIO and setup
configuration in your current project.
wdio install Add a reporter, service, or framework
to your WebdriverIO project. The command
installs the package from NPM, adds it to
your package.json and modifies the
wdio.conf.js accordingly.
wdio repl [capabilities] Run WebDriver session in command line
wdio run Run your WDIO configuration file to
initialize your tests. (default)

–help Show help [boolean]
–version Show version number [boolean]
–watch Run WebdriverIO in watch mode [boolean]
-h, --hostname automation driver host address [string]
-p, --port automation driver port [number]
–path path to WebDriver endpoints (default “/”) [string]
-u, --user username if using a cloud service as automation backend
-k, --key corresponding access key to the user [string]
-l, --logLevel level of logging verbosity
[choices: “trace”, “debug”, “info”, “warn”, “error”, “silent”]
–bail stop test runner after specific amount of tests have
failed [number]
–baseUrl shorten url command calls by setting a base url[string]
-w, --waitforTimeout timeout for all waitForXXX commands [number]
-f, --framework defines the framework (Mocha, Jasmine or Cucumber) to
run the specs [string]
-r, --reporters reporters to print out the results on stdout [array]
–suite overwrites the specs attribute and runs the defined
suite [array]
–spec run only a certain spec file - overrides specs piped
from stdin [array]
–exclude exclude certain spec file from the test run - overrides
exclude piped from stdin [array]
–mochaOpts Mocha options
–jasmineOpts Jasmine options
–cucumberOpts Cucumber options
–autoCompileOpts Auto compilation options

wdio run wdio.conf.js --suite foobar Run suite on testsuite “foobar”
wdio run wdio.conf.js --spec Run suite on specific specs
./tests/e2e/a.js --spec ./tests/e2e/b.js
wdio run wdio.conf.js --spec Run scenario by line number
wdio run wdio.conf.js --spec Run scenarios by line number
wdio run wdio.conf.js --spec Run scenarios by line number in
./tests/e2e/a.feature:5:10 --spec single feature and another complete
./test/e2e/b.feature feature
wdio install reporter spec Install @wdio/spec-reporter
wdio repl chrome -u <SAUCE_USERNAME> -k Run repl in Sauce Labs cloud

@wdio/cli (v7.16.12)

import { join } from ‘path’;

SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions…js (node:internal/modules/cjs/loader:1435:10)
at Object.newLoader [as .js] (/Users/alekhya.m.mamilla/node_modules/pirates/lib/index.js:141:7)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at FileSystemPathService.loadFile (/Users/alekhya.m.mamilla/node_modules/@wdio/config/build/lib/FileSystemPathService.js:21:16)
alekhya.m.mamilla@AMAC02FC9DHMD6N typescript_playwright_appium-master_6Feb %