Unable to start Appium server 1.6 programmatically using AppiumDriverLocalService
See original GitHub issueDescription
I’ve installed node via brew then installed Appium 1.6 using NPM and tried running it with AppiumDriverLocalService. I wasn’t able to run Appium server on one of PC.
Environment
Node version 7.0.0 Appium version 1.6.0
Details
It happens on one machine another works well. I checked paths of main.js/appium.js etc. and they are the same on both PCs.
Code To Reproduce Issue
private AppiumDriverLocalService service;
private String serverAddress = "0.0.0.0";
DesiredCapabilities serverCapabilities = new DesiredCapabilities();
AppiumServiceBuilder builder = new AppiumServiceBuilder().withCapabilities(serverCapabilities);
builder.usingAnyFreePort();
builder.withIPAddress(serverAddress);
builder.withArgument(GeneralServerFlag.SESSION_OVERRIDE);
builder.withArgument(GeneralServerFlag.LOG_LEVEL, "warn");
service = builder.build();
service.start();
Ecxeption stacktraces
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) Buildiat io.appium.java_client.service.local.AppiumServiceBuilder.findNodeInCurrentFileSystem(AppiumServiceBuilder.java:160) at io.appium.java_client.service.local.AppiumServiceBuilder.checkAppiumJS(AppiumServiceBuilder.java:305) at io.appium.java_client.service.local.AppiumServiceBuilder.createArgs(AppiumServiceBuilder.java:386) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:299) at com.***.appium.helper.DriverManager.createAppiumDriver(DriverManager.java:49) at com.autotest.runners.BaseRunner.setUp(BaseRunner.java:77) at com.autotest.runners.advert.AdvertRunner.setUp(AdvertRunner.java:22) at com.autotest.runners.advert.BannerRunner.setUp(BannerRunner.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:143) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:169) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:753) at org.testng.TestRunner.run(TestRunner.java:607) at org.testng.SuiteRunner.runTest(SuiteRunner.java:368) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:363) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:321) at org.testng.SuiteRunner.run(SuiteRunner.java:270) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1284) at org.testng.TestNG.runSuitesLocally(TestNG.java:1209) at org.testng.TestNG.runSuites(TestNG.java:1124) at org.testng.TestNG.run(TestNG.java:1096) at com.autotest.Launcher.main(Launcher.java:72) Caused by: java.io.IOException: /usr/local/lib/node_modules /var/folders/wk/w9dbkg0x7gbdbcmr2c9pfwnw0000gn/T/get_path_to_default_node5052055597677988693.sh: line 4: shell_session_update: command not found
at io.appium.java_client.service.local.AppiumServiceBuilder.findNodeInCurrentFileSystem(AppiumServiceBuilder.java:161)
... 30 more
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
@shynkevich-alex Please try setting up the main.js path as well and update us,
Also were you able to run the server manually? Is path of node is setup in PATH on your PC?
I am getting below error in “service.start()”. Someone please help?
(node:1400) Warning: To load an ES module, set “type”: “module” in the package.json or use the .mjs extension. C:\Users\HP\AppData\Roaming\npm\node_modules\appium\lib\main.js:4 import { init as logsinkInit } from ‘./logsink’; ^^^^^^
SyntaxError: Cannot use import statement outside a module at wrapSafe (internal/modules/cjs/loader.js:1053:16) at Module._compile (internal/modules/cjs/loader.js:1101:27) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47