appium: NPM 7/8: ChromeDriver is not installed with Appium
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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (16 by maintainers)
Commits related to this issue
- chore(appium,support): cache result of check for local appium This is just a perf improvement. Anecdotally, this shaves 1-to-5 seconds off of an `appium driver` or `appium plugin` command, depending... — committed to appium/appium by boneskull 2 years ago
- chore(appium,support): cache result of check for local appium This is just a perf improvement. Anecdotally, this shaves 1-to-5 seconds off of an `appium driver` or `appium plugin` command, depending... — committed to appium/appium by boneskull 2 years ago
- chore(appium,support): cache result of check for local appium This is just a perf improvement. Anecdotally, this shaves 1-to-5 seconds off of an `appium driver` or `appium plugin` command, depending... — committed to appium/appium by boneskull 2 years ago
- chore(appium,support): cache result of check for local appium This is just a perf improvement. Anecdotally, this shaves 1-to-5 seconds off of an `appium driver` or `appium plugin` command, depending... — committed to appium/appium by boneskull 2 years ago
…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
@KazuCocoa Thanks for the link. Appium 2.0 seems to be affected by this bug too:
NPM 8 (folder
chromedriver
is missing after installation ❌ ):NPM 6.x (folder
chromedriver
with correct driver is present ✔️ ):