This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 17
Feb 2019

Appium was getting stared when I hit appium Command In terminal But while starting from server I’m getting below Error.

Exception in thread “main” io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: There is no installed nodes! Please install node via NPM (https://www.npmjs.com/package/appium#using-node-js) or download and install Appium app (http://appium.io/downloads.html)

Node Is Installed in my system Via Brew

Why It is working when i start from terminal but not getting started through Code

  • created

    Feb '19
  • last reply

    Feb '19
  • 16

    replies

  • 1.2k

    views

  • 4

    users

  • 1

    like

  • 6

    links

Below Is the Following Code:
private AppiumDriverLocalService service;
private AppiumServiceBuilder builder;
private DesiredCapabilities cap;

public void startServer() {
	//Set Capabilities
	cap = new DesiredCapabilities();
	cap.setCapability("noReset", "false");
	
	//Build the Appium service
	builder = new AppiumServiceBuilder();
	builder.withIPAddress("127.0.0.0");
	builder.usingPort(4723);
	builder.withCapabilities(cap);
	builder.withArgument(GeneralServerFlag.SESSION_OVERRIDE);
	builder.withArgument(GeneralServerFlag.LOG_LEVEL,"error");
	
	//Start the server with the builder
	service = AppiumDriverLocalService.buildService(builder);
	service.start();
}

try the buildDefaultService(), to check if default appium service is working.
AppiumDriverLocalService service
service = AppiumDriverLocalService.buildDefaultService();
service.start();

I’ve already tried this ,it also giving me the Same Error.
io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: There is no installed nodes!

I’m guessing it could be a Path Problem,which i’m not getting exactly where is the mess

to me it looks a permission issue, uninstall node and reinstall without using sudo or you can give the node path to Appium service builder.

take a look at AppiumServiceBuilder class in java client, also i checked path on my machine it shows /usr/local/bin/node

public final class AppiumServiceBuilder extends Builder<AppiumDriverLocalService, AppiumServiceBuilder> {
public static final String APPIUM_PATH = “APPIUM_BINARY_PATH”;
public static final String NODE_PATH = “NODE_BINARY_PATH”;
public static final String DEFAULT_LOCAL_IP_ADDRESS = “0.0.0.0”;
private static final List PATH_CAPABILITIES = ImmutableList.of(“keystorePath”, “chromedriverExecutable”, “app”);
private static final String APPIUM_FOLDER = “appium”;
private static final String BUILD_FOLDER = “build”;
private static final S

@Tahir_Akhlaq i am installing appium with “npm”. and i start appium using any java executor and “appium” command.

Ahh…I remember used to get these errors in eclipse, it would not even recognise adb. Intellij Works like a charm !!

2 REALLY BIG problems with your setup.

  1. NODE_HOME. Really? Where did this come from? I think you should add node’s location to your PATH variable. I did a quick search for NODE_HOME and couldn’t find any reference to that. Don’t just make stuff up and expect it to work.
  2. /usr/bin/node. That is not the path. When giving a path you only need to specify the directory node is inside of. So if it’s really inside /usr/bin, that’s all you should need. However, on my Mac the path is /usr/local/bin/node, which would make the path /usr/local/bin <-you can find where node lives by typing: which node in the terminal.

If you don’t understand environment variables please read this:

http://www.linfo.org/path_env_var.html