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

Windows 11: Error: spawn wmic ENOENT #5311

Open
oplexz opened this issue Feb 21, 2022 · 2 comments
Open

Windows 11: Error: spawn wmic ENOENT #5311

oplexz opened this issue Feb 21, 2022 · 2 comments

Comments

@oplexz
Copy link

oplexz commented Feb 21, 2022

What's going wrong?

Error caught while calling pidusage
PM2      | Error: Error: spawn wmic ENOENT
PM2      |     at ChildProcess.<anonymous> (C:\Users\Daniil\AppData\Roaming\npm\node_modules\pm2\node_modules\pidusage\lib\bin.js:33:10)
PM2      |     at ChildProcess.emit (node:events:526:28)
PM2      |     at ChildProcess.emit (node:domain:475:12)
PM2      |     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
PM2      |     at onErrorNT (node:internal/child_process:476:16)
PM2      |     at processTicksAndRejections (node:internal/process/task_queues:83:21)

How could we reproduce this issue?

  1. ecosystem.config.js
module.exports = {
    apps: [{
        name: "tg-steam-2fa",
        script: "./index.js",
        watch: true
    }]
}
  1. pm2 start ecosystem.config.js

Supporting information

This issue has been reported before (#3873, #4954).

I'm running Windows 11 (build 22557.ni_release.220210-1445), and it appears that wmic has been deprecated in Windows 11 dev builds.

--- PM2 report ----------------------------------------------------------------
Date                 : Mon Feb 21 2022 17:23:40 GMT+0300 (Moscow Standard Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.2.0
node version         : 17.5.0
node path            : not found
argv                 : C:\Program Files\nodejs\node.exe,C:\Users\Daniil\AppData\Roaming\npm\node_modules\pm2\lib\Daemon.js
argv0                : node
user                 : undefined
uid                  : N/A
gid                  : N/A
uptime               : 26min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.2.0
node version         : 17.5.0
node path            : not found
argv                 : C:\Program Files\nodejs\node.exe,C:\Users\Daniil\AppData\Roaming\npm\node_modules\pm2\bin\pm2,report
argv0                : node
user                 : Daniil
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : win32
type                 : Windows_NT
cpus                 : Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
cpus nb              : 8
freemem              : 1984905216
totalmem             : 8464355328
home                 : C:\Users\Daniil
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬─────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name            │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼─────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ tg-steam-2fa    │ default     │ 1.0.0   │ fork    │ 10936    │ 24m    │ 0    │ online    │ 0%       │ 0b       │
 Daniil   │ disabled │
└─────┴─────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
C:\Users\Daniil\.pm2\pm2.log last 20 lines:
PM2        | 2022-02-21T17:19:34: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:19:34: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:20:04: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:20:04: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:20:34: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:20:34: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:21:04: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:21:04: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:21:34: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:21:34: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:22:04: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:22:04: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:22:34: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:22:34: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:23:04: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:23:04: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:23:34: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:23:34: PM2 error: Error: Error: spawn wmic ENOENT
PM2        | 2022-02-21T17:23:40: PM2 error: Error caught while calling pidusage
PM2        | 2022-02-21T17:23:40: PM2 error: Error: Error: spawn wmic ENOENT
oplexz added a commit to oplexz/telegram-steam-totp that referenced this issue Feb 21, 2022
@oplexz oplexz changed the title Error caught while calling pidusage; Error: Error: spawn wmic ENOENT Windows 11: Error: spawn wmic ENOENT Mar 22, 2022
@jalmarverbraak
Copy link

I have been having this same issue, Any updates on how to fix this or at least not throw that many errors in my logs

@ccubed
Copy link

ccubed commented Nov 27, 2024

Windows 11 no longer has WMIC as it has been replaced by the WMI interface. You can enable it by following the instructions here but the real fix is that PM2 would have to move away from WMIC and use the WMI interface.

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

3 participants