1

I have been facing same issue due to 'sharp' module when I try to launch appium server from mac terminal. enter image description here

Software Versions:

  • Mac 13.4 (22F66)
  • Processor 1.4 GHz Quad-Core Intel Core i5
  • Appium v2.0.0-rc.3
  • Java 11
  • Node 20.3.0
  • NPM 9.7.1
  • uiautomator2@2.26.1

Exception:

[Appium] Welcome to Appium v2.0.0-rc.3
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at 
/Users/manish/.appium/node_modules/appium-uiautomator2-driver
[Appium] Could not load driver 'uiautomator2', so it will not 
be available. Error in loading the driver was: 
[Appium] Something went wrong installing the "sharp" module
[Appium] Cannot find module '../build/Release/sharp-darwin- 
 x64.node'
[Appium] Require stack:
[Appium] - /Users/manish/.appium/node_modules/appium-uiautomator2-driver/node_modules/sharp/lib/sharp.js

Below is What I have tried:

  1. Uninstalling Appium v1.22.3 and then installing Appium 2.0
  2. Updating Node and Npm version to their latest versions.
  3. Appium server error says to install sharp using “npm install --platform=darwin --arch=x64 sharp” but after successful installation also I am getting same issue.
  4. Checked official sharp version to check the compatibility, it looks ok to me. https://sharp.pixelplumbing.com/install#prebuilt-binaries
  5. Tried to install sharp-cli. “npm i sharp-cli”.
  6. Tried to install sharp globally using an admin account.
  7. Updated homebrew also ran brew upgrade.
  8. changed permissions in of node_module.
  9. Uninstalled sharp and reinstalled it globally and also rebuild it. npm uninstall sharp npm install -g sharp npm cache clean --force sudo npm rebuild sharp

1 Answers1

0

Have you tried uninstalling driver? and reinstalling it?

  1. appium driver uninstall uiautomator2
  2. appium driver install uiautomator2
ChrisMersi
  • 76
  • 9
  • Yes I tried npm uninstall appium-uiautomator2-driver but it did not work either after reinstalling. The command which you mentioned gives error -- Error: npm command 'uninstall appium-uiautomator2-driver' failed with code 190 – Manish Arya Jun 16 '23 at 10:07