Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

bug: Can't start Appium server through code - getting 'npm' executable is not found when even though npm is there

Offen
#2,037 16 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java

Rechercherichtung

Beginnen Sie mit AppiumServiceBuilder und AppiumDriverLocalService unter Verwendung der bereitgestellten macOS-Pfade und konzentrieren Sie sich darauf, wie die npm-Executable und PATH vor dem Start aufgelöst werden. Reproduzieren Sie den Fehler mit dem Minimalbeispiel und überprüfen Sie, dass der lokale Appium-Server erfolgreich startet und unter 127.0.0.1:4723/status antwortet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug
Do I have the most recent component updates?
  • I use the most recent available driver/plugin and server versions
Is the component officially supported by the Appium team?
  • I have verified the component repository is present under the Appium organization in GitHub
Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

I wanted to upgrade from Appium 1.x to Appium 2.x+ but have been facing an issue when trying to run the appium server from the code. I get this error before it times out: [Appium] 'npm' executable is not found neither in the process working folder (/Users/[user]/Projects/povio-automated-qa) nor in any folders specified in the PATH environment variable (/usr/bin:/bin:/usr/sbin:/sbin). After Timeout I get this:

[The local appium server has not been started, Reason: Timed out waiting for [http://127.0.0.1:4723/status] to be available 
after 20003 ms, Consider increasing the server startup timeout value (currently 20000ms), Node.js executable path: 
/usr/local/bin/node, Arguments: [/opt/homebrew/bin/appium, --port, 4723, --address, 127.0.0.1, --log, 
/Users/[user]/Projects/povio-automated-qa/target/resources/appium_server_logs1, --session-override], Output: [Appium] 
'npm' executable is not found neither in the process working folder (/Users/mmeholli/Projects/povio-automated-qa) nor in any 
folders specified in the PATH environment variable (/usr/bin:/bin:/usr/sbin:/sbin)
]

I have tried increasing the timeout, upgrading and downgrading appium, selenium, java, node, and have checked environmental variables for any potential fix, but nothing works.

This is the current code that I'm working with:

AppiumServiceBuilder appiumServiceBuilder = new AppiumServiceBuilder();
        appiumServiceBuilder.usingPort(PORT)
                .withIPAddress("127.0.0.1")
                .withAppiumJS(new File("/opt/homebrew/bin/appium"))
                .usingDriverExecutable(new File("/usr/local/bin/npm"))
                .withArgument(GeneralServerFlag.SESSION_OVERRIDE)
                .withLogFile(new File(System.getProperty("user.dir") + "/target/resources/appium_server_logs" + Thread.currentThread().getId()));
        service = AppiumDriverLocalService.buildService(appiumServiceBuilder);
        service.start();

I am using:
Appium 2.0.1
java-client 8.6.0
Selenium 4.9.1

Expected Behavior

I am expecting the appium server to start from the code

Minimal Reproducible Example
AppiumServiceBuilder appiumServiceBuilder = new AppiumServiceBuilder();
        appiumServiceBuilder.usingPort(PORT)
                .withIPAddress("127.0.0.1")
                .withAppiumJS(new File("/opt/homebrew/bin/appium"))
                .usingDriverExecutable(new File("/usr/local/bin/npm"))
                .withArgument(GeneralServerFlag.SESSION_OVERRIDE)
                .withLogFile(new File(System.getProperty("user.dir") + "/target/resources/appium_server_logs" + Thread.currentThread().getId()));
        service = AppiumDriverLocalService.buildService(appiumServiceBuilder);
        service.start();
Environment
Link to Appium Logs

No response

Further Information

No response

Vorherrschende Sprache
Java
Sterne
1.3k
Forks
755
Ø Merge
5 T. 14 Std.
Gemergte PRs (30 T.)
8

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus appium/java-client

Alle Issues in appium/java-client

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.