Jenkins ver无法识别Node Js。 2.138.3

时间:2019-05-03 04:19:31

标签: maven jenkins jenkins-plugins appium

我正在尝试使用maven和我的jenkins服务器执行Appium黄瓜测试。我收到此错误。我已经安装了NodeJS + Plugin并重新启动了服务器。不过,我的詹金斯(Jenkins)工作仍然引发了我这个错误。这是我正在使用的错误日志和版本,如果有人可以帮助解决此问题,很高兴。

在5.097s中更新了1个程序包 npm 6.4.1 节点v10.15.3 appium v​​1.9.1 java“ 1.8.0_201”

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:155)
    at io.appium.java_client.service.local.AppiumServiceBuilder.checkAppiumJS(AppiumServiceBuilder.java:309)
    at io.appium.java_client.service.local.AppiumServiceBuilder.createArgs(AppiumServiceBuilder.java:389)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:332)
    at io.appium.java_client.service.local.AppiumDriverLocalService.buildService(AppiumDriverLocalService.java:76)
    at utils.AppiumServerUtils.<init>(AppiumServerUtils.java:18)
    at appium.BaseTest.launchAppiumServer(BaseTest.java:136)
    at steps.common.CommonSteps.beforeScenario(CommonSteps.java:24)
    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 cucumber.runtime.Utils$1.call(Utils.java:40)
    at cucumber.runtime.Timeout.timeout(Timeout.java:16)
    at cucumber.runtime.Utils.invoke(Utils.java:34)
    at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60)
    at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:224)
    at cucumber.runtime.Runtime.runHooks(Runtime.java:212)
    at cucumber.runtime.Runtime.runBeforeHooks(Runtime.java:202)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:40)
    at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:38)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at cucumber.api.junit.Cucumber.run(Cucumber.java:100)
    at utils.CustomRunner.run(CustomRunner.java:18)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at org.testng.junit.JUnit4TestRunner.start(JUnit4TestRunner.java:81)
    at org.testng.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:69)
    at org.testng.TestRunner$1.run(TestRunner.java:689)
    at org.testng.TestRunner.runWorkers(TestRunner.java:1014)
    at org.testng.TestRunner.privateRunJUnit(TestRunner.java:720)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
    at org.testng.SuiteRunner.run(SuiteRunner.java:261)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
    at org.testng.TestNG.run(TestNG.java:1048)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132)
    at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:112)
    at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: java.io.IOException: /tmp/get_path_to_default_node5935932351970587419.sh: line 2: npm: command not found

1 个答案:

答案 0 :(得分:0)

此错误似乎是在告诉您您要在其上运行测试的Jenkins从站上未安装Node。尽管您可能已经在Jenkins中安装了NodeJS插件,但是您将需要使用要使用的节点版本来配置作业。

https://wiki.jenkins.io/display/JENKINS/NodeJS+Plugin