Unable to install drivers

Hello again,

I’ve been getting along fine with Appium but now I can’t resolve this error. I’m opening an Appium port but have no drivers installed, so I am running the command to install said drivers.
appium driver install uiautomator2

This is returning:
:heavy_multiplication_x: Installing ‘uiautomator2’ using NPM install spec ‘appium-uiautomator2-driver’
Error: :heavy_multiplication_x: Encountered an error when installing package: npm command ‘install --save-dev appium-uiautomator2-driver --json’ failed with code 1.

STDOUT:

STDERR:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/appium
npm ERR! appium@"^1.22.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer appium@"^2.0.0-beta.40" from [email protected]
npm ERR! node_modules/appium-uiautomator2-driver
npm ERR! dev appium-uiautomator2-driver@"" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/chaffe/.npm/eresolve-report.txt for a full report.
{
“error”: {
“code”: “ERESOLVE”,
“summary”: “unable to resolve dependency tree”,
“detail”: “\nWhile resolving: undefined@undefined\nFound: [email protected]\nnode_modules/appium\n appium@”^1.22.3" from the root project\n\nCould not resolve dependency:\npeer appium@"^2.0.0-beta.40" from [email protected]\nnode_modules/appium-uiautomator2-driver\n dev appium-uiautomator2-driver@"
" from the root project\n\nFix the upstream dependency conflict, or retry\nthis command with --force, or --legacy-peer-deps\nto accept an incorrect (and potentially broken) dependency resolution.\n\nSee /Users/chaffe/.npm/eresolve-report.txt for a full report."
}
}

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/chaffe/.npm/_logs/2022-11-17T21_06_52_000Z-debug-0.log

That’s the full error. Honestly, not sure what I can do next to resolve the dependency tree error so would appreciate any help!

You should install Appium 2.0

Thanks for both suggestions, so, I re-ran npm i -g appium@next to be ensure I’m on the latest version, installed, ran the driver command and got the same error.
appium -v  :heavy_check_mark:  1125  14:18:55
2.0.0-beta.46

Then I followed the other suggestion to uninstall and reinstall, which I done, and now:
appium driver install uiautomator2  :heavy_check_mark:  1129  14:38:31
zsh: command not found: appium

appium -v  127 ↵  1130  14:38:34
zsh: command not found: appium

Ooof

First uninstall all. Check appium command not found. Now install appium 2. Check appium command found. Continue with drivers.

Before reinstalling all of this, I went the hassle with Wreed here (Appium command not found) and had a few issues. How can I not have to do all of this again with this installation?

Just do this. I was facing same issue and got it resolved with this.

Action:
Navigate to users/userName directory and delete the following folder and files

  • /node_modules/
  • package.json
  • package.lock.json

These above files refer to earlier appium installation.

then try to run command to install appium drivers, you should be good now!

1 Like

This solved it for me ( obviously)
But it would be nice to have a solution that could properly remove old appium instead of you clearing out all your node packages