Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Install Chromium driver #99

Closed
itkhanz opened this issue Jun 5, 2023 · 5 comments
Closed

Unable to Install Chromium driver #99

itkhanz opened this issue Jun 5, 2023 · 5 comments

Comments

@itkhanz
Copy link

itkhanz commented Jun 5, 2023

Hi,
I have just installed Appium 2.0 on my MacBook where I am facing the issue of not being able to install appium-chromium-driver. I have the following system and appium version:

Appium 2.0.0-beta.71
Node v18.16.0
NPM 9.6.7
macOS Ventura 13.4
JDK 11.0.2

I was able to install all the other available drivers like XCUITest, Espresso, UiAutomator2 etc. but I am not able to install the appium-chromium-driver.
I have also tried installing the drivers with following commands directly:

appium driver install chromium
appium driver install --source git https://github.com/appium/appium-chromium-driver.git --package appium-chromium-driver

I also tried installing it via appium-installer utility plugin but it also throws the same error.
I get this error:

✖ Installing 'chromium' using NPM install spec 'appium-chromium-driver'
Error: ✖ Encountered an error when installing package: npm command 'install --save-dev --omit=peer --save-exact --global-style --no-package-lock appium-chromium-driver --json' failed with code 1.

STDOUT:
{
  "error": {
    "code": 1,
    "summary": "command failed",
    "detail": "sh -c node install-npm.js\n[13:51:54] Error installing Chromedriver: Cannot find module '@appium/types'\nRequire stack:\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/build/lib/basedriver/driver.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/build/lib/index.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/index.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/utils.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/storage-client.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/install.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/install-npm.js\n[13:51:54] Error: Cannot find module '@appium/types'\nRequire stack:\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/build/lib/basedriver/driver.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/build/lib/index.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/index.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/utils.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/storage-client.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/install.js\n- /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/install-npm.js\n    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\n    at Function.Module._load (node:internal/modules/cjs/loader:920:27)\n    at Module.require (node:internal/modules/cjs/loader:1141:19)\n    at require (node:internal/modules/cjs/helpers:110:18)\n    at Object.<anonymous> (/Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/lib/basedriver/driver.js:18:1)\n    at Module._compile (node:internal/modules/cjs/loader:1254:14)\n    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)\n    at Module.load (node:internal/modules/cjs/loader:1117:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:958:12)\n    at Module.require (node:internal/modules/cjs/loader:1141:19)\n    at require (node:internal/modules/cjs/helpers:110:18)\n    at Object.<anonymous> (/Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/lib/index.js:8:1)\n    at Module._compile (node:internal/modules/cjs/loader:1254:14)\n    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)\n    at Module.load (node:internal/modules/cjs/loader:1117:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:958:12)\n[13:51:54] Downloading Chromedriver can be skipped by setting the'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable."
  }
}

STDERR:
npm WARN config global-style This option has been deprecated in favor of `--install-strategy=shallow`
npm ERR! code 1
npm ERR! path /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver
npm ERR! command failed
npm ERR! command sh -c node install-npm.js
npm ERR! [13:51:54] Error installing Chromedriver: Cannot find module '@appium/types'
npm ERR! Require stack:
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/build/lib/basedriver/driver.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/build/lib/index.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/index.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/utils.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/storage-client.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/install.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/install-npm.js
npm ERR! [13:51:54] Error: Cannot find module '@appium/types'
npm ERR! Require stack:
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/build/lib/basedriver/driver.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/build/lib/index.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/index.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/utils.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/storage-client.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/build/lib/install.js
npm ERR! - /Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/appium-chromedriver/install-npm.js
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:920:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1141:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:110:18)
npm ERR!     at Object.<anonymous> (/Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/lib/basedriver/driver.js:18:1)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1254:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1117:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:958:12)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1141:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:110:18)
npm ERR!     at Object.<anonymous> (/Users/xxxx/.appium/node_modules/appium-chromium-driver/node_modules/@appium/base-driver/lib/index.js:8:1)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1254:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1117:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:958:12)
npm ERR! [13:51:54] Downloading Chromedriver can be skipped by setting the'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable.

When I run the command appium driver ls, then i get the result:

✔ Listing available drivers
- uiautomator2@2.25.2 [installed (npm)]
- xcuitest@4.30.2 [installed (npm)]
- espresso@2.23.1 [installed (npm)]
- safari@3.3.3 [installed (npm)]
- gecko@1.1.9 [installed (npm)]
- mac2 [not installed]
- chromium [not installed]

2023-06-05T12_25_22_117Z-debug-0.log

Could you please look into this issue and provide some hint what might be causing this problem?

@KazuCocoa
Copy link
Member

Perhaps APPIUM_SKIP_CHROMEDRIVER_INSTALL=1 in the case will help. Then, potentially you may need to coordinate chromedriver capabilities as https://github.com/appium/appium-chromium-driver#capabilities

@itkhanz
Copy link
Author

itkhanz commented Jun 5, 2023

I referred to this GitHub issue appium/appium#18006 where it is mentioned that I had to manually install the package @appium/types globally so to be able to install chromium driver.

So First i ran the command npm install -g @appium/types
and then installed chromium driver which worked for me on Mac.
This solution worked for me.

Though I am not sure why the error occured in first place itself.

@itkhanz itkhanz closed this as completed Jun 5, 2023
@jlipps
Copy link
Member

jlipps commented Jun 5, 2023

we should not need to globally install @appium/types. that's weird.

@bliu13
Copy link

bliu13 commented Jul 21, 2023

I ran into the same problem and there were no problems installing the other supported appium drivers. There's no mention in the documentation that you need to install @appium/types yourself. What's the rationale for not specifically including @appium/types as a dependency when this package needs it to be able to install correctly?

@jlipps
Copy link
Member

jlipps commented Jul 24, 2023

@bliu13 what were the commands you used to install appium and this driver and what was the error output received

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants