Unable to start appium server using code -java client on windows os

Hi Team,
I am trying to setup appium 2.0 with java client and selenium. Chrome driver works fine and invokes the chrome browser but the appium driver doesn’t start the session and getting one of below errors

Server not started a session.
nodejs is not found
connecton reset error.

Just FYI… i did set up nodejs path in the env variables, removed all the traces of nodejs and re-installed from scratch and also one more thing i have observed is that the node_modules path is getting changed in multiple locations (different in intellij and different in command line).

One of the error messages:
Setting up Appium service
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: Could not find installed driver to support given caps)

I have already installed appium drivers using “appium driver chromium” and repeated same for uiautomator2 drivers.
I tried everything with no luck.

Location error:
[Appium] Attempting to load driver chromium…
[debug] [Appium] Requiring driver at C:\Users\xxxxx.t\node_modules\appium-chromium-driver
[Appium] Attempting to load driver uiautomator2…
[debug] [Appium] Requiring driver at C:\Users\trinadh.t\node_modules\appium-uiautomator2-driver
[Appium] Appium REST http interface listener started on http://127.0.0.1:4723
[Appium] Available drivers:
[Appium] - [email protected] (automationName ‘Chromium’)
[Appium] - [email protected] (automationName ‘UiAutomator2’)

executing “mvn test” from different folder i get this error:

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: Could not find installed driver to support given caps)

Could you try starting the server with the following parameter:

appium server -pa /wd/hub

I think your code, or the java client you are using, is looking on that path, but Appium 2 defaults to ‘/’ path. More here: