Hello just want to ask a question as I’m still new to appium when I run my test I’m getting this error for appium:
e [35m[Appium]e[39m Could not load driver 'uiautomator2', so it will not be available. Error in loading the driver was:
e[35m[Appium]e[39m Something went wrong installing the "sharp" module
e[35m[Appium]e[39m
e[35m[Appium]e[39m Cannot find module '../build/Release/sharp-darwin-x64.node'
which in return result to this:
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Could not find a driver for automationName 'UIAutomator2' and platformName 'ANDROID'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error:
Something went wrong installing the "sharp" module
This issue does not occur if I run appium normally from the terminal and appium is working find through the appium inspector when I start session
What I’ve tried:
Tried lowering appium version
reinstall appium
change permissions in of node_modules (Thought maybe its a permission issue)
Hope you can help me with this issue I don’t need sharp at the moment I don’t know why its installing during when I run the test. Thank you
I’m not understanding when the problem is occurring. Seems like it is working normally most times, what is the difference that makes the problem occur?
Hello, sorry for the confusion the issue was that when I start appium via a ServerManager class it is trying to install sharp module for some reason
e[35m[Appium]e[39m { port: e[33m26280e[39m, sessionOverride: e[33mtruee[39m }
e[35m[Appium]e[39m Attempting to load driver uiautomator2...
[debug] e[35m[Appium]e[39m Requiring driver at /Users/cj/.appium/node_modules/appium-uiautomator2-driver
e[35m[Appium]e[39m Could not load driver 'uiautomator2', so it will not be available. Error in loading the driver was:
e[35m[Appium]e[39m Something went wrong installing the "sharp" module
e[35m[Appium]e[39m
e[35m[Appium]e[39m Cannot find module '../build/Release/sharp-darwin-x64.node'
But when I start Appium normally in the terminal it would run and wont install sharp
[Appium] Welcome to Appium v2.0.0-rc.1
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at /Users/cj/.appium/node_modules/appium-uiautomator2-driver
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723
[Appium] You can provide the following URLS in your client code to connect to this server:
[Appium] http://127.0.0.1:4723/
[Appium] http://192.168.254.202:4723/
[Appium] Available drivers:
[Appium] - [email protected] (automationName 'UiAutomator2')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
Basically what I’m trying to do is start appium automatically but appium is trying to install a module when I run it automatically, is there any way I can disable/skip appium to make the installation of modules optional ex. sharp module
Hello Aleksei, thank you for the reply. I’ve also tried this command but still encountering the issue. I don’t know why appium is trying to install a module when I run automatically but when I run it manually via the appium command in the terminal it works fine.
I have been facing same issue due to ‘sharp’ module when I try to launch appium server from mac terminal. Below are the things which I tried but doesn’t seems to be working for me
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.
Tried to install sharp globally using admin account.
Updated homebrew also ran brew upgrade.
change permissions in of node_module
Exception:
manish@arya-MAC ~ % appium --use-driver uiautomator2
[Appium] Welcome to Appium v2.0.0-rc.3
[Appium] Non-default server args:
[Appium] {
[Appium] useDrivers: [
[Appium] ‘uiautomator2’
[Appium] ]
[Appium] }
[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]
[Appium] Cannot find module ‘…/build/Release/sharp-darwin-x64.node’
Ok, I’ve never heard of ServerManager, and when I do a websearch there seem to be a lot of them. I’m not sure what ServerManager gives you, but I would look directly at how it is starting the Appium server, like what options is it using, etc. There is something different about the way it starts that I just can’t tell from your description. Enable logging if you can or run in verbose mode.
Thank you for the help on this issue, for now I’m running appium manually instead of implementing a servermanager to run appium automatically. Still not sure why this is happening. I’m using rc.3 of appium.