Spawn c windows system32 cmd exe enoent
“If there is one thing developers like less than writing documentation, it’s responding to unnecessary escalations […] and too many escalations wear down the developers.”
Tom Limoncelli
Site Reliability Engineering Manager at Stack Overflow
“We needed a better place to store all the questions and answers that people were repeatedly asking, and we discovered Stack Overflow for Teams.”
Suyog Rao
Director of Engineering at Elastic Cloud
“We use Stack Overflow for Teams internally when onboarding new developers, and when new developers ask questions, everyone can benefit from the shared knowledge.”
Roberta Arcoverde
Principal Software Developer at Stack Overflow
Teams
Connect and share knowledge within a single location that is structured and easy to search.
On executing react-native run-android, got an error message «Error: spawn cmd.exe ENOENT»
Environment:
react: 16.0.0-alpha.6,
react-native: 0.43.1
OS: Windows 10
node.js: 6.9.2
yarn: 0.22.0
Kindly assist to solve the issue.
3 Answers 3
packager port (8088) and tcp port (8081) are not same. Issue solved when both the ports are same.
Run command ‘adb reverse tcp:8081 tcp:8081’ in your android sdk platform tools folder.
I think you don’t have yarn installed try installing it with chocolatey or something. It should be installed before creating your project (react-native init command).
Edit: In the recent version of react-native they have fixed it. If you want complete freedom from this just uninstall node (For complete uninstallation Completely remove node refer this link) and reinstall node, react-native-cli then create your new project.
Not the answer you’re looking for? Browse other questions tagged react-native or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.14.39087
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
“If there is one thing developers like less than writing documentation, it’s responding to unnecessary escalations […] and too many escalations wear down the developers.”
Tom Limoncelli
Site Reliability Engineering Manager at Stack Overflow
“We needed a better place to store all the questions and answers that people were repeatedly asking, and we discovered Stack Overflow for Teams.”
Suyog Rao
Director of Engineering at Elastic Cloud
“We use Stack Overflow for Teams internally when onboarding new developers, and when new developers ask questions, everyone can benefit from the shared knowledge.”
Roberta Arcoverde
Principal Software Developer at Stack Overflow
Teams
Connect and share knowledge within a single location that is structured and easy to search.
Problem with npm start (error : spawn cmd ENOENT)
I have a problem with my application. Because before when I created an application it worked, but now, it shows me this error and I do not know why and the things I have to do to fix it.
I checked some stackoverflow topics but everywhere I checked, it was not really an answer that worked.
5 Answers 5
Add C:\Windows\System32 to the global PATH environment variable.
Solution 1
Solution 2
If the first one doesn’t work follow the 2nd steps. Navigate to your project folder and type this command >>>
Solution 3
Downgrade react-scripts in package.json file
I had the same problem after I tried to install Mongo DB. I found out that this problem only exists with react-scripts@3.0.0. Try to reinstall your npm with a different react script version. Simply go to your folder in command and reinstall like this:
After that the app worked for me again.
For all those Who’ve come to this problem from react scripts not starting. The solution is
Not the answer you’re looking for? Browse other questions tagged node.js reactjs git-bash or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.14.39087
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Error: spawn cmd.exe ENOENT using WSL since 9.0.0 #7251
Comments
simakas commented Jun 20, 2019
Is this a bug report?
Did you try recovering your dependencies?
Which terms did you search for in User Guide?
cmd event.js ENOENT
Environment
/.nvm/versions/node/v8.11.4/bin/npm
Browsers:
Chrome: Not Found
Firefox: 64.0
npmPackages:
react: 16.8.6
react-dom: 16.8.6
react-scripts: 3.0.1
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
Expected Behavior
app should start using v 9.0.0
Actual Behavior
Reproducible Demo
Simply run Ubuntu or other distro on Windows WSL, upgrade to 9.0.0, same is valid for any project I tried using v9.0.0.
The text was updated successfully, but these errors were encountered:
mrmckeb commented Jun 23, 2019
Hi @simakas, this looks to be related to this issue: #7094 (comment)
Can you see if that resolves it for you, and if so, please close this off.
cheshrkat commented Jun 25, 2019
@mrmckeb I’ve hit this issue as well; tried the path fix mentioned in that comment and it didn’t resolve the problem. No change to steps or symptom/error message.
My environment info, for reference:
/.nvm/versions/node/v10.15.3/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
react: ^16.8.6 => 16.8.6
react-dom: ^16.8.6 => 16.8.6
react-scripts: 3.0.1 => 3.0.1
npmGlobalPackages:
create-react-app: Not Found
cheshrkat commented Jun 25, 2019 •
What’s strange is that I’m pretty sure CRA used to work without that path set, which suggests something changed in the way it detects the environment and launches the app in browser (perhaps it was providing the path). While this workaround seems to work, I’d be a bit wary of relying on it; plus it’s not particularly uncommon for WSL users to remove windows locations from their PATH.
mrmckeb commented Jun 25, 2019
Thanks for the update @cheshrkat. it is a strange issue. And you’re right, I ran on WSL for two years with no issue.
I’m not sure what (if anything) changed recently, but as I’m currently on a Mac (employers choice) I can’t troubleshoot.
If you do find a cause on our side, feel free to raise a PR. In the meantime I’ll close this off and people will hopefully find it in search if they have this issue.
hristov296 commented Jun 27, 2019
Having the same issue with react-scripts ver 3.0.1. Rollback to 2.1.8 does not have the issue. I tried the suggestions of adding C:\Windows\System32 to the PATH, but it didn’t work for me. Here is the npm log of the error
https://pastebin.com/YbUEBSPw
mrmckeb commented Jul 1, 2019
@hristov296 can you give output as above? Details of your environment, and versions?
hristov296 commented Jul 1, 2019 •
/.nvm/versions/node/v12.5.0/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
react: ^16.8.6 => 16.8.6
react-dom: ^16.8.6 => 16.8.6
react-scripts: ^3.0.1 => 3.0.1
npmGlobalPackages:
create-react-app: Not Found
After some digging, I think it might be related to a newer version of webpack-dev-server
My system variables, for reference.
bugzpodder commented Jul 2, 2019
Need to look into this a bit further, I didn’t get any troubles when running npm start using WSL 1 and just regular command prompt on my windows 10 box. I am using a preview build that also supports WSL 2 though..
atlefren commented Jul 15, 2019
Can confirm that this issue occurs on my machine, running react-scripts 3.0.1
Microsoft Windows [Version 10.0.18890.1000]
With NO windows paths set I get the error
Things work as expected.
An older project, using react-scripts 2.1.5 works fine without updating the path.
I agree with @cheshrkat that this is a wonky workaround, and that WSL users does not want to pollute their WSL with windows paths.
I would gladly test further improvements or provide more feedback if needed
atlefren commented Jul 15, 2019
Found another workaround:
This error stems from the fact that CRA tries to open your browser:
In order to skip opening the browser, add
atlefren commented Jul 15, 2019
Turns our, in the cases that this fails on my machine, the browser variable sent to the startBrowserProcess in
I tried adding the following:
to line 90 of node_modules/react-dev-utils/openBrowser.js and things again worked as expected.
I’m not sure if you want a PR with this, or if this info is enough?
Also: Not sure if this issue persists on master, where the opn library has been replaced with open?
mrmckeb commented Jul 15, 2019
atlefren commented Jul 15, 2019
I’ll give it a try tomorrow! Just wanted to know if I should base this off master, or the relevant branch for the 3.0.1 version of react-scripts? Also: how do I run CRA from a local copy? (aka: where do I find relevant docs for development)
mrmckeb commented Jul 15, 2019
The easiest ways to test locally are with (assuming Yarn, but npm has the same things):
bugzpodder commented Jul 15, 2019
If you are only touching one file, I think the easiest way is to just goto node_modules/react_scripts and modify the file directly.
drwatsoncode commented Aug 1, 2019 •
This problem is not caused by the browser argument in openBrowser being undefined. That variable is supposed to be undefined in most cases (unless the user has set the BROWSER environment variable).
One workaround is to set BROWSER to «none». This will prevent any browser from being launched.
The former command will not alter your current shell while the latter will, so choose the one that suits your needs best.
curreta commented Aug 29, 2019
FWIW I had previously edited my windows registry to exclude windows paths for an unrelated issue as per this comment. Changing it back to 7 «fixed» this issue for me.
atlefren commented Aug 30, 2019
I am rather certain that assuming that everybody has their windows paths present in WSL is to beg for trouble.
Whether this is a CRA-issue, an open issue or a WSL issue is more of an academic question. The problem is that many WSL users will have an issue when updating to CRA 3.0, with no decent error messages.
As we’ve found in sindresorhus/open#144 this issue is possible to solve in the open library.
FWIW I had previously edited my windows registry to exclude windows paths for an unrelated issue as per this comment. Changing it back to 7 «fixed» this issue for me.
HamburgerTwo commented Dec 6, 2019
I have resolve this problem by granted access to windows system permissions for wsl, may be the problem caused by some library run «cmd.exe» commend but wsl doesn’t have the permissions to excute the windows’s program
AaronFriel commented Dec 11, 2019 •
Edit: I’ve traced it down here: sindresorhus/open#157
I don’t know how or why cmd.exe is being invoked, but I can reproduce this on my machine when building and run an image from Docker on Windows. Setting BROWSER: none in docker-compose.yml fixes it.
takasoft commented Jan 13, 2020 •
This is probably the easiest fix. Just modify the start script in package.json
devfarhan86 commented Apr 22, 2020
Append this to your Path it worked fine for me.
grenade commented Jun 13, 2020
there’s not really a simple way to fix this for wsl that isn’t ugly for other platforms. a simple workaround for wsl users is to just temporarily append the required path by modifying package.json so that the yarn start command is prefixed with a temporary PATH var that contains the folder containing cmd.exe. on most ubuntu wsl setups this looks like this:
mostaffa commented Jul 28, 2020
Just Add the following to your System Environment (PATH):
%SystemRoot%\system32
it worked with me
ireznik commented Aug 20, 2020
This error stems from the fact that CRA tries to open your browser:
In order to skip opening the browser, add
Thanks for saving me time
jtwing62173 commented Sep 4, 2020 •
# shim to enable openBrowser from react-dev-tools to find and launch browser using powershell.exe export PATH=$PATH:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/
What I would REALLY prefer. is for ‘them’ to fix it. I’d submit a pull request myself but I can’t be arsed to fiddle with all of the process required to test every permutation on every system combination.
Выскакивает C:\Windows\System32\cmd.exe как убрать командную строку
Иногда при включении компьютера во время чтения приложений в автозапуске открывается окно командной строки с определенной командой. В этом случае пользователь закономерно задается вопросом: «Windows system32 cmd exe — что это и чем грозит подобное поведение системы?» Такая проблема довольно часто встречается, и в статье пойдет речь о том, как определить виновника события и разрешить ситуацию в свою пользу.
Причины возникновения
Панель интерпретатора командной строки, неожиданно появляющаяся после загрузки ОС, может быть свидетельством изменения некоторых системных настроек сторонними приложениями. Но это не единственная причина его появления на рабочем столе.
Краткий перечень факторов помещения cmd exe windows в автозапуск:
У некоторых пользователей черное окно CMD открывается в ситуации:
К чему может привести игнорирование ошибки?
Если задействованы встроенные утилиты или программы, которым можно доверять, опасаться нечего. Исправить проблему на слабом ПК можно только посредством его апгрейда. Для примера, в десятой версии Windows часто встречаются подобные баги, так как система особо требовательна к ресурсам компьютера.
Но если же причиной запуска системной утилиты стал вирус, то определенно можно ждать полного выхода из строя всей файловой системы. Для избавления от «черного окна» следует предпринять несколько простых действий.
Алгоритм решения проблемы
Для начала стоит провести диагностику ОС посредством встроенных утилит:
Если после безопасного входа строка с надписью system32 на черной панели снова выскакивает, то, вероятно, за это отвечает определенный системный процесс. Когда в область Start прописывается вредоносный код, после диагностического запуска окно cmd.exe не включается автоматически.
Чтобы избавиться от ошибки, стоит для начала очистить системный реестр и директории от лишнего мусора, накопившегося вследствие действий пользователя:
Владельцам десятки позволено решать подобные проблемы через командную строку:
Также можно использовать оснастку «Планировщика задач», если окно командной строки постоянно маячит на рабочем столе и мешает работе:
Выводы
Строгое следование инструкции должно помочь. Но случается и так, что спустя некоторое время cmd.exe снова вылезает на рабочий стол. В данном случае стоит обратиться к специалистам в сервисный центр Microsoft, приложив к письму подробный отчет о сложившейся ситуации.
В статье мы лишь частично изложили материал по тому, как удалить определенную запись в автозапуске. Для борьбы с некоторыми видами зловредных кодов понадобятся углубленные знания по работе системы и эксплуатации программных комплектов. Но в большинстве случаев вышеизложенного алгоритма вполне достаточно для исправления указанного бага.
“If there is one thing developers like less than writing documentation, it’s responding to unnecessary escalations […] and too many escalations wear down the developers.”
Tom Limoncelli
Site Reliability Engineering Manager at Stack Overflow
“We needed a better place to store all the questions and answers that people were repeatedly asking, and we discovered Stack Overflow for Teams.”
Suyog Rao
Director of Engineering at Elastic Cloud
“We use Stack Overflow for Teams internally when onboarding new developers, and when new developers ask questions, everyone can benefit from the shared knowledge.”
Roberta Arcoverde
Principal Software Developer at Stack Overflow
Teams
Connect and share knowledge within a single location that is structured and easy to search.
How do I debug “Error: spawn ENOENT” on node.js?
When I get the following error:
What procedure can I follow to fix it?
Author note: Lots of issues with this error encouraged me to post this question for future references.
Related questions:
26 Answers 26
NOTE: This error is almost always caused because the command does not exist, because the working directory does not exist, or from a windows-only bug.
I found a particular easy way to get the idea of the root cause of:
The problem of this error is, there is really little information in the error message to tell you where the call site is, i.e. which executable/command is not found, especially when you have a large code base where there are a lot of spawn calls. On the other hand, if we know the exact command that cause the error then we can follow @laconbass’ answer to fix the problem.
I found a very easy way to spot which command cause the problem rather than adding event listeners everywhere in your code as suggested in @laconbass’ answer. The key idea is to wrap the original spawn call with a wrapper which prints the arguments send to the spawn call.
Here is the wrapper function, put it at the top of the index.js or whatever your server’s starting script.
Then the next time you run your application, before the uncaught exception’s message you will see something like that:
In this way you can easily know which command actually is executed and then you can find out why nodejs cannot find the executable to fix the problem.