3

I'm currently working on a Discord Bot using javascript. I recently updated my NodeJS version to the LTS (12.16.2), my npm to 5.7.1 and my pm2 to 4.4.0.

I can start my process perfectly fine with "pm2 start index.js", however as the process goes along it will start to shoot this weird error about WMIC (this error also happens when trying to restart).

PM2      | Error caught while calling pidusage
PM2      | Error: Error: spawn wmic ENOENT
PM2      |     at ChildProcess. (C:\Users\myuser\AppData\Roaming\npm\node_modules\pm2\node_modules\pidusage\lib\bin.js:33:10)
PM2      |     at ChildProcess.emit (events.js:311:20)
PM2      |     at ChildProcess.EventEmitter.emit (domain.js:482:12)
PM2      |     at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
PM2      |     at onErrorNT (internal/child_process.js:469:16)
PM2      |     at processTicksAndRejections (internal/process/task_queues.js:84:21)

I have updated my Environment Variables to include "C:\Windows\System32\wbem" and I can confirm that folder exists and has WMIC.exe in it. I have also tried doing "pm2 start index.js --update-env". Some help with this error would be wonderful.

Harrison Howard
  • 345
  • 3
  • 13

0 Answers0