React Packager fails; must reboot computer every 3-5 times app is reloaded - react-native

I get the error shown below every 3-5 times I reload the iOS app for React Packager. When restarting Xcode with that error, I see this in the packager window:
"login: fork: Resource temporarily unavailable
[Process exited - exit code 1]"
The above will not even allow opening any terminal on the Mac.
The only way to make it work is to REBOOT the machine (Running OS X 10.10.5, react-native 0.10 stable and also 0.11 stable)
WARN: not opened
Launching Dev Tools...
TypeError: Cannot read property 'addListener' of undefined
at exports.execFile (child_process.js:234:15)
at Object.handle (/Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/packager/packager.js:198:7)
at next (/Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/node_modules/connect/lib/proto.js:190:15)
at Object.openStackFrameInEditor [as handle] (/Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/packager/packager.js:184:5)
at next (/Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/node_modules/connect/lib/proto.js:190:15)
at IncomingMessage.<anonymous> (/Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/packager/packager.js:174:5)
at emitNone (events.js:67:13)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:893:12)
at doNTCallback2 (node.js:429:9)
ERROR spawn /Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/packager/launchChromeDevTools.applescript EAGAIN
{"code":"EAGAIN","errno":"EAGAIN","syscall":"spawn /Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/packager/launchChromeDevTools.applescript","path":"/Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/packager/launchChromeDevTools.applescript","spawnargs":["http://localhost:8081/debugger-ui"]}
Error: spawn /Users/brianmcginnis/learn/react-native2/senior-tab/SeniorTab/node_modules/react-native/packager/launchChromeDevTools.applescript EAGAIN
at exports._errnoException (util.js:837:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at doNTCallback2 (node.js:429:9)
at process._tickCallback (node.js:343:17)
See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
Process terminated. Press <enter> to close the window

Try updating to the latest version of Native.
Also, if you are running your sim in xcode, you can clear the cache of your project by using command+shift+k with the project stopped.
See if this clears it whenever you have the problem.

I installed latest version of react native, then uninstalled iojs. I installed latest Node.js and everything now works.

Related

React native device 'adb' not found

I am trying to open my react native app on the android studio device emulator but I am facing an error :
Couldn't start a project on Android: Error running adb: spawn emulator ENOENT
Error running adb: spawn emulator ENOENT
Also, my emulator is in running condition. how to fix this
make sure code is working on web, then restart AVD. by closing it completely. mine is working now. but after some time whenever there is any error in code it crashes again and repeating the process makes it working. also before starting in AVD please close web testing.

React Native Expo 41 app crashing on debug remotejs enabling

I am new to react-native and having the following issue.When I run app without enabling remotejs dubug option from my device, it works fine.But as soon as I enable the debug remotejs after shaking the device, app crashes wit the following error in the console and the app crashes.
(node:1064) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
error Command failed with exit code 1
Expo: 41.0.1
react: 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz
Resolved it by adding C:\Windows\System32\ to path variable then restarting computer.

Could not get status from metro bundler

I keep getting the same error message when I run expo start. It keeps saying
Could not get status from Metro bundler. connect ECONNREFUSED 127.0.0.1:19001
Connecting to Metro bundler failed.
I've uninstalled and reinstalled expo-cli
I've uninstalled and reinstalled node
I've tried expo start -c
Nothing worked
This is the full error message
C:\Users\smiz\Desktop\dev\react-native\cleaningservices>expo start
Starting project at C:\Users\smiz\Desktop\dev\react-native\cleaningservices
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
Could not get status from Metro bundler. connect ECONNREFUSED 127.0.0.1:19001
Connecting to Metro bundler failed.
Error: Connecting to Metro bundler failed.
at _waitForRunningAsync (C:\#expo\xdl#58.0.19\src\Project.ts:1268:11)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at startReactNativeServerAsync (C:\#expo\xdl#58.0.19\src\Project.ts:1612:3)
at Object.startAsync (C:\#expo\xdl#58.0.19\src\Project.ts:1985:5)
at action (C:\Users\Stephen Murya\AppData\Roaming\npm\node_modules\expo-cli\src\commands \start.ts:163:3)
at C:\Users\Stephen Murya\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:330:16
at Command.<anonymous> (C:\Users\Stephen Murya\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:332:7)
I have run this project in the past using expo. I don't know why this all started.
So I solved this before posting this question, but I left it here for anyone this might help.
Run npm clean --force, and restart expo. I would also advice to restart your device(s)

Running `expo start` fails with ENOENT error just after installing expo-cli on windows 10

I'm on Windows 10 Version 10.0.16299 Build 16299. I'm using Powershell. I just used yarn global add expo-cli to install expo, then I ran expo init my-app then cd my-app and expo start, but the build is failing. Here's the error image and text:
[23:11:49] Starting project at C:\projects\my-app
[23:11:58] Starting Metro Bundler on port 19001.
[23:11:58] Metro Bundler ready.
[23:12:00] Expo DevTools is running at http://localhost:19002
[23:12:00] Opening DevTools in the browser... (press shift-d to disable)
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
at onErrorNT (internal/child_process.js:406:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Any ideas? Or even suggestions on another place where I can post this issue since it's failing out of the box. All help appreciated.
For windows:-
add environment variable in
set Path - C:\Windows\System32\
after setting path. restart your computer.
In my case, I added C:\Windows\System32\
See the Picture below:

React Native, Error while Launching Dev Tools. in ubuntu 16

I have installed a new react native project using create-react-native-app. When I do yarn start or npm start and scan with expo, it gives me the following error in ubuntu (when remote js debugging is on).
Launching Dev Tools...
Google Chrome exited with error: Error: Exited with code 1
at ChildProcess. (/home/shivam/AwesomeProject/node_modules/opn/index.js:86:8)
at Object.onceWrapper (events.js:254:19)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Socket.stream.socket.on (internal/child_process.js:363:11)
at Socket.emit (events.js:159:13)
at Pipe._handle.close [as _onclose] (net.js:568:12)
Finished building JavaScript bundle in 95196ms
Stopping packager...
Packager stopped.
Done in 701.25s.
But its not the case with windows(it opens the debugger in browser).I guess in ubuntu It tries to launch debugger in browser, but somehow fails to do so. I followed some links but none of them helped.
https://github.com/facebook/react-native/issues/9901
https://github.com/facebook/react-native/issues/990
https://github.com/facebook/react-native/issues/297
Run yarn or npm without sudo, because when you enable devtools it's tries opening chrome by command (chrome won't open with sudo)
You can do it open google chrome and hit this url http://localhost:8081/debugger-ui
open console tab to debug
Disable Chrome cache
Right-click chrome
Go to 'inspect element'
Look for the 'network' tab somewhere at the top. Click it.
Check the 'disable cache' checkbox.
Reference : react-native-debugging