env-cmd fails on WSL2
See original GitHub issueenv-cmd 9.0.3 env: Windows 10 WSL2
env-cmd -f ./.env.staging my-build-script
Error: spawn EPERM
at ChildProcess.spawn (internal/child_process.js:394:11) at Object.spawn (child_process.js:535:9)
at Object.spawn (/home/jdunlap/n/lib/node_modules/env-cmd/node_modules/cross-spawn/index.js:12:24) at Object.<anonymous> (/home/jdunlap/n/lib/node_modules/env-cmd/dist/env-cmd.js:57:30)
at Generator.next (<anonymous>)
at fulfilled (/home/jdunlap/n/lib/node_modules/env-cmd/dist/env-cmd.js:4:58) { errno: 'EPERM',
code: 'EPERM',
syscall: 'spawn'
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
WSL2 Server Environment Setup Fail server env-setup Not ...
Issue Type: Bug. On all wsl2 open commands, server fails at start. Version: 1.55.0-insider (system setup)
Read more >Command not found in WSL2 even though it's on the path
1 Answer 1 · Start WSL without your startup profile. It's very likely that something (or you) added a line that is causing...
Read more >Troubleshooting Windows Subsystem for Linux | Microsoft Learn
Provides detailed information about common errors and issues people run into while running Linux on the Windows Subsystem for Linux.
Read more >Fix NPM No Such File Error on WSL2 - PäksTech
The npm command would fail with a “no such file or directory error” like this: $ npm install /usr/bin/env: 'bash\r': No such file...
Read more >How to set up DISPLAY variable for WSL2 of ubuntu 20?
For Me, to make xlaunch X11 server works properly, I have to set DISPLAY every time the host localhost IP is changed using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Closing this for now as I don’t have time to set up the Windows env again to test. Hopefully there’s a better way to diagnose problematic wsl PATH issues in the future (if that’s the issue).
I had to leave wsl2 due to the bug… I’ll give it another try over the weekend if I can with the ‘clean PATH’ trick. Anything else I should try?