I have been facing same issue due to 'sharp' module when I try to launch appium server from mac terminal.
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:
- Uninstalling Appium v1.22.3 and then installing Appium 2.0
- Updating Node and Npm version to their latest versions.
- 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.
- Checked official sharp version to check the compatibility, it looks ok to me. https://sharp.pixelplumbing.com/install#prebuilt-binaries
- Tried to install sharp-cli. “npm i sharp-cli”.
- Tried to install sharp globally using an admin account.
- Updated homebrew also ran brew upgrade.
- changed permissions in of node_module.
- 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