Skip to content

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

Closed as not planned
@MikeMcC399

Description

@MikeMcC399

ps-tree has a dependency on the deprecated Windows Management Instrumentation command-line (WMIC) utility

Issue

ps-tree fails under GitHub Actions windows-2025 with the error

Error: spawn wmic.exe ENOENT

ps-tree depends on 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, and there are no plans to add it. (See Windows Server 2025 is now in public preview).

Steps to reproduce

Run the following workflow in this repo in GitHub Actions

name: ci-test
on: [push, pull_request, workflow_dispatch]

jobs:

  ps-tree-ci:
    strategy:
      fail-fast: false
      matrix:
        node: [22]
        os: [windows-2025]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node }}
      - run: node -v
      - run: npm -v
      - name: Checkout
        uses: actions/checkout@v4
      - run: npm ci
      - run: npm test
      - run: npm run coverage

Logs

Run npm test

> [email protected] test
> istanbul cover node_modules/tape/bin/tape test/test.js

TAP version 13
# Spawn a Parent process which has ten Child processes
=============================================================================
Writing coverage object [D:\a\ps-tree\ps-tree\coverage\coverage.json]
Writing coverage reports at [D:\a\ps-tree\ps-tree\coverage]
=============================================================================

=============================== Coverage summary ===============================
Statements   : 27.5% ( 11/40 )
Branches     : 16.67% ( 3/18 )
Functions    : 20% ( 1/5 )
Lines        : 27.5% ( 11/40 )
================================================================================
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions