Could not get status from metro bundler - react-native

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)

Related

Getting Building iOS bundle error when trying to build an android app - expo -react-native

I was able to build app using expo build:android previously. However, after upgrading to latest expo version I get following error:
connect ECONNREFUSED 127.0.0.1:19001
Set EXPO_DEBUG=true in your env to view the stack trace.
I also see the following lines in the log:
Publishing to channel 'default'...
Building iOS bundle
I don't added ios to my app.json, I only need to build an android apk. To do that I use expo build:android -t app-bundle
I also removed package-lock.json and node_modules and run npm install, but I get the same error.
I run expo start on another cmd and then run expo build:android -t app-bundle still get same error
Also when I clear expo cache, see the following log:
Restarting Metro Bundler...
Starting Metro Bundler on port 19001.
Couldn't adb reverse: adb.exe: error: Invalid source port: 'undefined'
I had faced same issue myself and found the solution. Expo is looking for localhost:19001 which is not running. Just follow following steps and it should work as expected:
Run expo start no terminal and once it opens up the
browser where you will find this line written Starting Metro
Bundler on port 19001.
Now open another terminal instance and run expo build:android.

connect ECONNREFUSED 127.0.0.1:19001 when trying to do `expo publish`

I get this error message when trying to run the expo publish command.
Building iOS bundle
connect ECONNREFUSED 127.0.0.1:19001
Set EXPO_DEBUG=true in your env to view the stack trace.```
I tried updating expo to the latest version, didn't work.
I am using expo-cli version 3.11.9, node version 12.9.0 and npm version 6.10.2.
Any info would be appreciated, thanks in advance.
This error occurs because the React Native application is not running. To avoid this kind of error, you must first start the application and at the same time open another window to run the compile command.
I had the same problem. But after some research (https://forums.expo.io/t/error-when-trying-to-run-exp-publish/223), I found that deleting the .expo folder in your project fixes the problem.
Let me know if that worked for you.

wrapItem(...).trimStart in Expo and React native

Today I create a new project with create-react-native-app and after installing dependencies CRNA says to start your project with expo start, after running this command all thing seems good and a chrome open page localhost:19002 but after a minute this page is stoped and in the console it says :
[12:26:47] Starting project at D:\Try\eleventh
[12:27:13] Warning: Problem validating app.json: Unable to perform cache
refresh for C:\Users\Mohammad\AppData\Local\Expo\schema-30.0.0.json:
Error: connect ETIMEDOUT 35.202.142.166:443.
[12:27:39] Starting Metro Bundler on port 19001.
[12:27:39] Metro Bundler ready.
[12:27:40] Opening on Android device
[12:27:40] Successfully ran `adb reverse`. Localhost URLs should work on
the connected Android device.
[12:27:44] Tunnel ready.
[12:27:44] Expo DevTools is running at http://localhost:19002
[12:27:44] Opening DevTools in the browser... (press shift-d to disable)
exp://192.168.89.2:19000
To run the app with live reloading, choose one of:
[12:27:44] wrapItem(...).trimStart is not a function
[12:27:44] Set EXPO_DEBUG=true in your env to view the stack trace.
as you see it says :
wrapItem(...).trimStart is not a function
and this is some information may be useful :
create-react-native-app version: 2.0.2
node version: v8.11.3
expo version: 2.2.0
npm version: 6.4.0
yarn version:1.10.1
Try using a later version of node. I ran into this issue as well using node version 8. Bumping it with nvm to node 12 worked.

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 Packager fails; must reboot computer every 3-5 times app is reloaded

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.