-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WSL] Error: spawn cmd.exe ENOENT #4125
Comments
Info: WSL 被错当成 Windows WSL Mistaken for Windows |
Is your WSL environment based on Debian? I’ve noticed some strange behaviours with npm in Debian Buster that I’ve not been able to reproduce with the official nodejs binaries and updated versions of npm (node is v10.15.2 and npm 5.8.0 in Debian Buster). Among those were hanging |
I think this error is related to this create-react-app issue which is caused by the way the browser is launched in WSL (using cmd.exe which is not in the PATH). The root problem may be in the opn aka open npm package. A workaround is to add e.g.: PATH="$PATH:/mnt/c/Windows/System32" /node_modules/.bin/vue-cli-service serve or export PATH="$PATH:/mnt/c/Windows/System32"
/node_modules/.bin/vue-cli-service serve The former command will not alter your current shell while the latter will, so choose the one that suits your needs best. |
Disable browser auto-opening by edit
see also https://webpack.js.org/configuration/dev-server/#devserveropen |
Version
3.5.3
Reproduction link
https://github.com/PanJiaChen/vue-element-admin
Environment info
Steps to reproduce
yarn install
./node_modules/.bin/vue-cli-service serve
What is expected?
without error
What is actually happening?
$ ./node_modules/.bin/vue-cli-service serve
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
The text was updated successfully, but these errors were encountered: