WSL: WSL2: EPERM error for syscall spawn
WSL2
Using Node 12.5.0
Windows Version 10.0.18922 Build 18922
Error: spawn EPERM
at ChildProcess.spawn (internal/child_process.js:394:11) at Object.spawn (child_process.js:535:9) at
errno: 'EPERM',
code: 'EPERM',
syscall: 'spawn'
The process is being run without sudo/root permissions (it’s being run as a regular user).
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (1 by maintainers)
WSL2 Ubuntu. Start it up. Create a directory. cd into it. run “code .”.
That was it. Nothing special.
I had the same problem. I think it is related to Windows Defender, because I reproduce this problem by the following steps:
I ran strace -f on my call to ‘code .’ and this is the error:
[pid 8224] execve(“/mnt/c/ProgramData/Oracle/Java/javapath/cmd.exe”, [“cmd.exe”, “/C”, “C:\Users\Dad\AppData\Local\Progr”…, “–folder-uri=vscode-remote://wsl”…, “–remote=wsl+Ubuntu”], 0x28b7a60 /* 24 vars */) = -1 EPERM (Operation not permitted)
At this point we’re execve’ing to find cmd.exe in each of the directories on the path.
This directory is a leftover from an old Java install. javapath is a junction:
.2018-12-14 11:20 PM <JUNCTION> javapath [C:\ProgramData\Oracle\Java\javapath_target_956312]
Removing this directory from my path solved the EPERM problem.
I had the same problem useing VSCode on wsl2. I share the behavior to reproduce and it’s output.
the information about Windows OS :
Windows 10 Home Insider PreviewOS Build :18932.1000the behavior and the output