Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: spawn wmic.exe ENOENT on Windows Server 2025 #398

Open
MikeMcC399 opened this issue Dec 20, 2024 · 0 comments
Open

Error: spawn wmic.exe ENOENT on Windows Server 2025 #398

MikeMcC399 opened this issue Dec 20, 2024 · 0 comments

Comments

@MikeMcC399
Copy link

Relates to issue:

Issue

[email protected] fails under GitHub Actions windows-2025 with the error

Error: spawn wmic.exe ENOENT

start-server-and-test depends on ps-tree, which depends on the deprecated wmic.

For Microsoft Windows Servers, wmic has been deprecated since 2016 and it is not installed by default on Windows Server 2025 (see Features we're no longer developing).

The GitHub Actions runner image windows-2025, currently in beta status, does not include WMIC. (See Windows Server 2025 is now in public preview).

Steps to reproduce

Run the following workflow in this repo in GitHub Actions

name: test-windows-2025
on: workflow_dispatch
jobs:
  tests1:
    runs-on: windows-2025
    steps:
      - name: Checkout 🛎
        uses: actions/checkout@v4

      - name: Node version 🖨️
        run: node -v

      - name: NPM install
        uses: bahmutov/npm-install@v1

      - name: Run demo 1 📊
        run: npm run demo

Logs

Run npm run demo

> [email protected] demo
> node src/bin/start.js http://127.0.0.1:9000 message

1: starting server using command "npm run start"
and when url "[ 'http://127.0.0.1:9000' ]" is responding with HTTP status code 200
running tests using command "npm run message"


> [email protected] start D:\a\start-server-and-test\start-server-and-test
> node test/server.js

sleeping for 5 seconds before starting
listening at port 9000
HEAD

> [email protected] message D:\a\start-server-and-test\start-server-and-test
> echo Hi there 👋

Hi there 👋
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: spawn wmic.exe ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn wmic.exe',
  path: 'wmic.exe',
  spawnargs: [ 'PROCESS', 'GET', 'Name,ProcessId,ParentProcessId,Status' ]
}

Node.js v22.12.0
Error: Process completed with exit code 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant