question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPM 7/8: ChromeDriver is not installed with Appium

See original GitHub issue

The problem

I would expect that this command installs appium and ChromeDriver. But no “ChromeDriver postinstall” step is performed:

$ sudo npm install -g appium@1.15 --chromedriver_version="98.0.4758.102"
added 588 packages, and audited 589 packages in 27s

37 vulnerabilities (6 low, 21 moderate, 8 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

It only installs appium and doesn’t install ChromeDriver (missing folder chromedriver):

$ ll /usr/lib/node_modules/appium/node_modules/appium-chromedriver
total 64
drwxr-xr-x   4 root root  4096 May  7 16:05 ./
drwxr-xr-x 446 root root 20480 May  7 16:05 ../
drwxr-xr-x   3 root root  4096 May  7 16:05 build/
-rw-r--r--   1 root root   192 May  7 16:05 index.js
-rwxr-xr-x   1 root root  2952 May  7 16:05 install-npm.js*
drwxr-xr-x   2 root root  4096 May  7 16:05 lib/
-rw-r--r--   1 root root 11383 May  7 16:05 LICENSE
-rw-r--r--   1 root root  2075 May  7 16:05 package.json
-rw-r--r--   1 root root  6157 May  7 16:05 README.md

Also tested with the options --unsafe-perm=true --allow-root, but with the same result, still no success.

If I try the same command with NPM 6.14.17, it works well (it requires --unsafe-perm=true --allow-root, see https://github.com/appium/appium/issues/10020):

$ sudo npm install -g appium@1.15 --chromedriver_version="98.0.4758.102" --unsafe-perm=true --allow-root
/usr/bin/appium -> /usr/lib/node_modules/appium/build/lib/main.js
/usr/bin/authorize-ios -> /usr/lib/node_modules/appium/node_modules/.bin/authorize-ios

> appium-windows-driver@1.6.0 install /usr/lib/node_modules/appium/node_modules/appium-windows-driver
> node install-npm.js

Not installing WinAppDriver since did not detect a Windows system

> pre-commit@1.2.2 install /usr/lib/node_modules/appium/node_modules/pre-commit
> node install.js


> wd@1.11.4 install /usr/lib/node_modules/appium/node_modules/wd
> node scripts/build-browser-scripts


> core-js@2.6.9 postinstall /usr/lib/node_modules/appium/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> spawn-sync@1.0.15 postinstall /usr/lib/node_modules/appium/node_modules/spawn-sync
> node postinstall


> appium-chromedriver@4.16.0 postinstall /usr/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js

[16:10:57] [Chromedriver Install] Installing Chromedriver version '98.0.4758.102' for platform 'linux' and architecture '64'
[16:10:57] [Chromedriver Install] Opening temp file to write 'chromedriver_linux64' to...
[16:10:57] [Chromedriver Install] Opened temp file '/tmp/202247-396954-17iiu43.wh6t/chromedriver_linux64.zip'
[16:10:57] [Chromedriver Install] Downloading https://chromedriver.storage.googleapis.com/98.0.4758.102/chromedriver_linux64.zip...
[16:10:59] [Chromedriver Install] Writing binary content to /tmp/202247-396954-17iiu43.wh6t/chromedriver_linux64.zip...
[16:10:59] [Chromedriver Install] Extracting /tmp/202247-396954-17iiu43.wh6t/chromedriver_linux64.zip to /tmp/202247-396954-17iiu43.wh6t/chromedriver_linux64
[16:10:59] [Chromedriver Install] Creating /usr/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux...
[16:10:59] [Chromedriver Install] Copying unzipped binary, reading from /tmp/202247-396954-17iiu43.wh6t/chromedriver_linux64/chromedriver...
[16:10:59] [Chromedriver Install] Writing to /usr/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64...
[16:10:59] [Chromedriver Install] /usr/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64 successfully put in place
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.x (node_modules/appium/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/appium/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ appium@1.15.1
added 1390 packages from 1633 contributors in 15.105s

and ChromeDriver is installed correctly:

$ ll /usr/lib/node_modules/appium/node_modules/appium-chromedriver
total 80
drwxr-xr-x   5 root root  4096 May  7 16:10 ./
drwxr-xr-x 874 root root 32768 May  7 16:10 ../
drwxr-xr-x   3 root root  4096 May  7 16:10 build/
drwxr-xr-x   3 root root  4096 May  7 16:10 chromedriver/
-rw-r--r--   1 root root   192 Oct 26  1985 index.js
-rwxr-xr-x   1 root root  2952 Oct 26  1985 install-npm.js*
drwxr-xr-x   2 root root  4096 May  7 16:10 lib/
-rw-r--r--   1 root root 11383 Oct 26  1985 LICENSE
-rw-r--r--   1 root root  3028 May  7 16:10 package.json
-rw-r--r--   1 root root  6157 Oct 26  1985 README.md

Environment

  • Appium version (or git revision) that exhibits the issue: 1.15 or 1.22.3
  • Desktop OS/version used to run Appium: Ubuntu 20.04/22.04
  • Node.js version (unless using Appium.app|exe): v14.19.1
  • Package manager name and version (we only officially support NPM): 8.5.5

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:25 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
boneskullcommented, May 10, 2022

…So I don’t think it’s the shrinkwrap. I’ll see if I can’t wrangle more npm output out of appium driver install

1reaction
miraocommented, May 8, 2022

@KazuCocoa Thanks for the link. Appium 2.0 seems to be affected by this bug too:

NPM 8 (folder chromedriver is missing after installation ❌ ):

$ sudo npm install -g appium@next
$ CHROMEDRIVER_VERSION="98.0.4758.102" appium driver install uiautomator2
✔ Installing 'uiautomator2' using NPM install spec 'appium-uiautomator2-driver'
Driver uiautomator2@2.1.1 successfully installed
- automationName: UiAutomator2
- platformNames: ["Android"]

$ ll ~/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/
total 56
drwxrwxr-x   5 mirao mirao  4096 May  8 11:15 ./
drwxrwxr-x 267 mirao mirao 12288 May  8 11:15 ../
drwxrwxr-x   3 mirao mirao  4096 May  8 11:15 build/
drwxrwxr-x   2 mirao mirao  4096 May  8 11:15 config/
-rw-rw-r--   1 mirao mirao   192 May  8 11:15 index.js
-rwxrwxr-x   1 mirao mirao  2952 May  8 11:15 install-npm.js*
drwxrwxr-x   2 mirao mirao  4096 May  8 11:15 lib/
-rw-rw-r--   1 mirao mirao 11383 May  8 11:15 LICENSE
-rw-rw-r--   1 mirao mirao  2231 May  8 11:15 package.json
-rw-rw-r--   1 mirao mirao  4046 May  8 11:15 README.md

NPM 6.x (folder chromedriver with correct driver is present ✔️ ):

$ CHROMEDRIVER_VERSION="98.0.4758.102" appium driver install uiautomator2
✔ Installing 'uiautomator2' using NPM install spec 'appium-uiautomator2-driver'
Driver uiautomator2@2.1.1 successfully installed
- automationName: UiAutomator2
- platformNames: ["Android"]

$ ll ~/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/
total 60
drwxrwxr-x   6 mirao mirao  4096 May  8 11:20 ./
drwxrwxr-x 268 mirao mirao 12288 May  8 11:20 ../
drwxrwxr-x   3 mirao mirao  4096 May  8 11:20 build/
drwxrwxr-x   3 mirao mirao  4096 May  8 11:20 chromedriver/
drwxrwxr-x   2 mirao mirao  4096 May  8 11:20 config/
-rw-rw-r--   1 mirao mirao   192 Oct 26  1985 index.js
-rwxrwxr-x   1 mirao mirao  2952 Oct 26  1985 install-npm.js*
drwxrwxr-x   2 mirao mirao  4096 May  8 11:20 lib/
-rw-rw-r--   1 mirao mirao 11383 Oct 26  1985 LICENSE
-rw-rw-r--   1 mirao mirao  3285 May  8 11:20 package.json
-rw-rw-r--   1 mirao mirao  4046 Oct 26  1985 README.md
$ ll ~/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_linux64_v98.0.4758.102 
-rwxr-xr-x 1 mirao mirao 21127624 May  8 11:20 /home/mirao/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_linux64_v98.0.4758.102*
Read more comments on GitHub >

github_iconTop Results From Across the Web

No Chromedriver found that can automate Chrome '78.0.3904 ...
I am testing an Android Hybrid App on Mac with IntelliJ Java. I have an instance of AndroidDriver. It works with the native...
Read more >
Appium did not support chrome browser version 76
Appium version 1.14.1 did not support chrome browser latest version 76 and higher. I tried to find so many possible solutions but still, ......
Read more >
appium-chromedriver - npm
Node.js wrapper around chromedriver. ... Start using appium-chromedriver in your project by running `npm i appium-chromedriver`.
Read more >
Unable to update Chromedriver on Mac in Katalon Studio
Downloaded the latest chromedriver.exe (version 77 and the beta 78 also) and tried putting each into Katalon Studio/Contents/Eclipse/ ...
Read more >
npm fails to install - Google Groups
Getting a rather long error when trying to run sudo npm install -g appium ... tools (sudo may not be necessary\nif you installed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found