Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell ENOENT" error while running npm start

When ever I try to execute npm start, this is what happens. I think there is some issue with powershell and not with npm because npm starts the development server. BTW I created basic react app using npx create-react-app. I checked, powershell file is there in the specified location and it is working as well. Guild me what should I do in order to resolve the error.

events.js:353
  throw er; // Unhandled 'error' event
  ^
Error: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:467:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell',
  path: 'C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell',
  spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBoAHQAdABwADoALwAvAGwAbwBjAGEAbABoAG8AcwB0ADoAMwAwADAAMAAiAA=='
  ]
}

Error Image

like image 564
Adhish Bahl Avatar asked May 18 '26 13:05

Adhish Bahl


2 Answers

I faced with a same problem on Windows 10. And solution was a pretty simple - just run your commands in git bush console.

like image 81
mavlikwowa Avatar answered May 20 '26 03:05

mavlikwowa


Try export BROWSER=none

Reference: https://github.com/facebook/create-react-app/issues/7251#issuecomment-827602712

I got this problem when using podman and wsl

like image 45
CWKSC work Avatar answered May 20 '26 01:05

CWKSC work