-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Troubleshoot ' 4058 ENOENT' error from NodeJS ‐ Python interpreter cannot be found
There are a few known causes for such an error when launching a process using NodeJS:
Error: spawn <configured shell> ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)] {
errno: -4058,
code: 'ENOENT',
You could be facing this issue due to your environment variables being misconfigured. Please see below for some potential fixes.
Make sure ComSpec
points to the correct value. Usually, it should point to ComSpec=C:\WINDOWS\system32\cmd.exe
.
You can fix it using the environment variable UI. In the start menu type 'environment`, and you should get this option
Navigate to Advanced -> Environment Variables...:
Find the ComSpec
variable in the System Environment variable section. Make sure it is set to C:\WINDOWS\system32\cmd.exe
or something similar. If it is not, click Edit and browse your directories to set it to the correct value.
Make sure to then close and re-open all instances of VS Code ComSpec
is set to an incorrect value.
If your ComSpec variable points to the correct value, your Path
variable might be missing certain directories such as C:\WINDOWS\system32
.
This is what it typically looks like:
Notice that C:\Windows\System32
is the first entry.
Similar to before, navigate to Advanced -> Environment Variables... in your system environment variable UI. Select the PATH
environment variable under system variables and click Edit.
In the edit view, make sure that system32 is at the top of the list. You can click the system32 entry and move it up as needed.
Fix that, then close and re-open all instances of VS Code.