Can't run my tests after npm package update

Hi. I’m using iOS simulator and wdio to automate my tests. I use ios 13.5 and iPhone 11 as my capabilities. But I wanted to try to test on ios 12.0 and iPhone 8 so I changed those capabilities. But it didn’t worked. So I switched back to my usual capabilities and it didn’t worked either. Then I updated Appium to v1.18 and also updated all my npm packages. Updated npm and node as well. Now when appium desktop is open with the server running I get the below errors on terminal:

2020-08-26T14:11:33.735Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-08-26T14:11:36.134Z ERROR @wdio/appium-service: Appium exited before timeout (exit code: 2)
[HTTP] Could not start REST http interface listener. The requested port may already be in use. Please make sure there is no other instance of this server running already.

2020-08-26T14:11:36.136Z ERROR @wdio/cli:utils: A service failed in the 'onPrepare' hook
Error: Appium exited before timeout (exit code: 2)
[HTTP] Could not start REST http interface listener. The requested port may already be in use. Please make sure there is no other instance of this server running already.

    at ChildProcess.<anonymous> (/Users/serrabassarac/development/appium/node_modules/@wdio/appium-service/build/launcher.js:103:16)
    at Object.onceWrapper (events.js:417:26)
    at ChildProcess.emit (events.js:310:20)
    at ChildProcess.EventEmitter.emit (domain.js:482:12)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Continue...
2020-08-26T14:11:36.138Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2020-08-26T14:11:36.141Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio.conf.js,--port,4723
[0-0] 2020-08-26T14:11:36.684Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2020-08-26T14:11:36.796Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] RUNNING in iOS - /test/specs/ios/regressionTests/registeredUser/userLoginWithEmail.spec.js
[0-0] 2020-08-26T14:11:38.609Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-08-26T14:11:38.614Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2020-08-26T14:11:38.615Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'iOS',
      'appium:deviceName': 'iPhone 11',
      'appium:platformVersion': '13.5',
      'appium:orientation': 'PORTRAIT',
      'appium:automationName': 'XCUITest',
      'appium:app': '/Users/serrabassarac/Library/Developer/Xcode/DerivedData/Mec-aoufwvafrcqxgqdsloktfqljbzxf/Build/Products/Debug-iphonesimulator/La3eb.app',
      'appium:noReset': false,
      'appium:newCommandTimeout': 240,
      'appium:showXcodeLog': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'iOS',
    'appium:deviceName': 'iPhone 11',
    'appium:platformVersion': '13.5',
    'appium:orientation': 'PORTRAIT',
    'appium:automationName': 'XCUITest',
    'appium:app': '/Users/serrabassarac/Library/Developer/Xcode/DerivedData/Mec-aoufwvafrcqxgqdsloktfqljbzxf/Build/Products/Debug-iphonesimulator/La3eb.app',
    'appium:noReset': false,
    'appium:newCommandTimeout': 240,
    'appium:showXcodeLog': true
  }
}
[0-0] 2020-08-26T14:11:38.805Z WARN webdriver: Request failed with status 404 due to The URL '/session' did not map to a valid resource
[0-0] 2020-08-26T14:11:38.806Z INFO webdriver: Retrying 1/3
[0-0] 2020-08-26T14:11:38.806Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2020-08-26T14:11:38.806Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'iOS',
      'appium:deviceName': 'iPhone 11',
      'appium:platformVersion': '13.5',
      'appium:orientation': 'PORTRAIT',
      'appium:automationName': 'XCUITest',
      'appium:app': '/Users/serrabassarac/Library/Developer/Xcode/DerivedData/Mec-aoufwvafrcqxgqdsloktfqljbzxf/Build/Products/Debug-iphonesimulator/La3eb.app',
      'appium:noReset': false,
      'appium:newCommandTimeout': 240,
      'appium:showXcodeLog': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'iOS',
    'appium:deviceName': 'iPhone 11',
    'appium:platformVersion': '13.5',
    'appium:orientation': 'PORTRAIT',
    'appium:automationName': 'XCUITest',
    'appium:app': '/Users/serrabassarac/Library/Developer/Xcode/DerivedData/Mec-aoufwvafrcqxgqdsloktfqljbzxf/Build/Products/Debug-iphonesimulator/La3eb.app',
    'appium:noReset': false,
    'appium:newCommandTimeout': 240,
    'appium:showXcodeLog': true
  }
}
[0-0] 2020-08-26T14:11:38.931Z WARN webdriver: Request failed with status 404 due to The URL '/session' did not map to a valid resource
[0-0] 2020-08-26T14:11:38.932Z INFO webdriver: Retrying 2/3
[0-0] 2020-08-26T14:11:38.942Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2020-08-26T14:11:38.943Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'iOS',
      'appium:deviceName': 'iPhone 11',
      'appium:platformVersion': '13.5',
      'appium:orientation': 'PORTRAIT',
      'appium:automationName': 'XCUITest',
      'appium:app': '/Users/serrabassarac/Library/Developer/Xcode/DerivedData/Mec-aoufwvafrcqxgqdsloktfqljbzxf/Build/Products/Debug-iphonesimulator/La3eb.app',
      'appium:noReset': false,
      'appium:newCommandTimeout': 240,
      'appium:showXcodeLog': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'iOS',
    'appium:deviceName': 'iPhone 11',
    'appium:platformVersion': '13.5',
    'appium:orientation': 'PORTRAIT',
    'appium:automationName': 'XCUITest',
    'appium:app': '/Users/serrabassarac/Library/Developer/Xcode/DerivedData/Mec-aoufwvafrcqxgqdsloktfqljbzxf/Build/Products/Debug-iphonesimulator/La3eb.app',
    'appium:noReset': false,
    'appium:newCommandTimeout': 240,
    'appium:showXcodeLog': true
  }
}
[0-0] 2020-08-26T14:11:39.036Z WARN webdriver: Request failed with status 404 due to The URL '/session' did not map to a valid resource
[0-0] 2020-08-26T14:11:39.040Z INFO webdriver: Retrying 3/3
[0-0] 2020-08-26T14:11:39.053Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2020-08-26T14:11:39.057Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'iOS',
      'appium:deviceName': 'iPhone 11',
      'appium:platformVersion': '13.5',
      'appium:orientation': 'PORTRAIT',
      'appium:automationName': 'XCUITest',
      'appium:app': '/Users/serrabassarac/Library/Developer/Xcode/DerivedData/Mec-aoufwvafrcqxgqdsloktfqljbzxf/Build/Products/Debug-iphonesimulator/La3eb.app',
      'appium:noReset': false,
      'appium:newCommandTimeout': 240,
      'appium:showXcodeLog': true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'iOS',
    'appium:deviceName': 'iPhone 11',
    'appium:platformVersion': '13.5',
    'appium:orientation': 'PORTRAIT',
    'appium:automationName': 'XCUITest',
    'appium:app': '/Users/serrabassarac/Library/Developer/Xcode/DerivedData/Mec-aoufwvafrcqxgqdsloktfqljbzxf/Build/Products/Debug-iphonesimulator/La3eb.app',
    'appium:noReset': false,
    'appium:newCommandTimeout': 240,
    'appium:showXcodeLog': true
  }
}
[0-0] 2020-08-26T14:11:39.086Z ERROR webdriver: Request failed with status 404 due to Error: The URL '/session' did not map to a valid resource
2020-08-26T14:11:39.086Z ERROR webdriver: Error: The URL '/session' did not map to a valid resource
    at getErrorFromResponseBody (/Users/serrabassarac/development/appium/node_modules/webdriver/build/utils.js:114:12)
    at WebDriverRequest._request (/Users/serrabassarac/development/appium/node_modules/webdriver/build/request.js:149:56)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at startWebDriverSession (/Users/serrabassarac/development/appium/node_modules/webdriver/build/utils.js:41:16)
    at Function.newSession (/Users/serrabassarac/development/appium/node_modules/webdriver/build/index.js:44:23)
    at remote (/Users/serrabassarac/development/appium/node_modules/webdriverio/build/index.js:75:20)
    at Runner._startSession (/Users/serrabassarac/development/appium/node_modules/@wdio/runner/build/index.js:206:50)
    at Runner._initSession (/Users/serrabassarac/development/appium/node_modules/@wdio/runner/build/index.js:175:21)
    at Runner.run (/Users/serrabassarac/development/appium/node_modules/@wdio/runner/build/index.js:93:15)
2020-08-26T14:11:39.088Z ERROR @wdio/runner: Error: Failed to create session.
The URL '/session' did not map to a valid resource
    at startWebDriverSession (/Users/serrabassarac/development/appium/node_modules/webdriver/build/utils.js:45:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[0-0]  Error:  Failed to create session.
The URL '/session' did not map to a valid resource 

Here are the appium logs:

appium-server-logs.txt (3.8 KB)

And when I don’t start server on appium desktop it doesn’t give any errors but it doesn’t run the tests either. It just installs app on the simulator and doesn’t do anything. Webdriver agent runner app doesn’t get installed.