question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run Appium 1.5 using AppiumDriverLocalService

See original GitHub issue

The problem

Installed Appium 1.5 using NPM and tried running it with AppiumDriverLocalService. I wasn’t able to run Appium server. Though same worked fine with Appium version 1.4.16.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.5.0
  • Last Appium version that did not exhibit the issue (if applicable): 1.4.16
  • Desktop OS/version used to run Appium: Mac OS X El Capitan
  • Node.js version (unless using Appium.app|exe): v5.5
  • Mobile platform: Android/iOS
  • Real Device

Details

Code Used: AppiumDriverLocalService service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().withStartUpTimeOut(5, TimeUnit.SECONDS)); service.start(); driver=new AndroidDriver(capabilities);

Appium Path:/usr/local/lib/node_modules/appium

Link to Appium logs

Error on Eclipse: 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) at io.appium.java_client.service.local.AppiumServiceBuilder.findNodeInCurrentFileSystem(AppiumServiceBuilder.java:107) at io.appium.java_client.service.local.AppiumServiceBuilder.checkAppiumJS(AppiumServiceBuilder.java:242) at io.appium.java_client.service.local.AppiumServiceBuilder.createArgs(AppiumServiceBuilder.java:248) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:299) at io.appium.java_client.service.local.AppiumDriverLocalService.buildService(AppiumDriverLocalService.java:194) at guide_config.Setup.setupAppium(Setup.java:53) at guide_testcases.E2E_Tests.beforeTest(E2E_Tests.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) at org.testng.TestNG.run(TestNG.java:1057) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175) Caused by: java.io.IOException: /usr/local/lib/node_modules

at io.appium.java_client.service.local.AppiumServiceBuilder.findNodeInCurrentFileSystem(AppiumServiceBuilder.java:110)
... 30 more

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
saikrishna321commented, Feb 29, 2016

@mayureshshirodkar

AppiumServiceBuilder builder = new AppiumServiceBuilder()
                .withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js"))
                .withArgument(GeneralServerFlag.APP, System.getProperty("user.dir") + "/build/wordpress.apk")
                .withArgument(GeneralServerFlag.LOG_LEVEL, "info")
                .withLogFile(new File(System.getProperty("user.dir") + "/target/logs/sample.txt"))
                .usingAnyFreePort()
        /* and so on */;
        appiumDriverLocalService = builder.build();
        appiumDriverLocalService.start();

You can also set appium server path when your starting the server, you don’t need to set in ENV variables

3reactions
mayureshshirodkarcommented, Feb 29, 2016

@SrinivasanTarget Looks like AppiumLocalService din’t pick up the default path to the main.js. It still pointed to appium.js whereas for Appium 1.5, it should have picked up main.js.

I had to set a environmental variable APPIUM_BINARY_PATH in my Eclipse Environment to ‘/usr/local/lib/node_modules/appium/build/lib/main.js’ and this worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid server instance exception has occured when using ...
Hi all, I'm trying to run Appium from the command line, ... instance exception has occured when using AppiumDriverLocalService on Windows.
Read more >
Launching and stopping appium server programmtically
Hi, Is there a way to launch/stop the appium server programmatically? Also is there way where can capture all the logs of appium...
Read more >
Unable to start appium service by AppiumDriverLocalSerivce
Hi Guys, Now i am trying to use page object model to design my selenium + appium framework. I wan to start the...
Read more >
I'm getting "The local appium server has not been started. The ...
Hi all, I try to run AppiumParallelTests with iOS physical device and I'm ... System.out.println(“No devices are free to run test or Failed...
Read more >
Why I can run appium.js in terminal but failed using java with ...
ENV: MAC10.11 Appium 1.4.13 I want to start Appium server using command in java. Code: CommandLine cl=CommandLine.parse("appium.js"); cl.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found