Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#2,037 16 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
mobile-dev, testing-qa

Hướng nghiên cứu

Bắt đầu với AppiumServiceBuilder và AppiumDriverLocalService bằng cách sử dụng các đường dẫn macOS được cung cấp, tập trung vào cách tệp thực thi npm và PATH được phân giải trước khi khởi động. Tái hiện lỗi bằng ví dụ tối thiểu và xác minh rằng máy chủ Appium cục bộ khởi động thành công và phản hồi tại 127.0.0.1:4723/status.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Java
Star
1.3k
Fork
755
Merge trung bình
5 ngày 14 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của appium/java-client

Tất cả issue của appium/java-client

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.