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

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

Related

ERR_FAILED (-2) error when running npx cypress open

I have a barebone create-react-app with nothing but cypress installed through npm i cypress
When I run npx cypress open I get this error:
ERR_FAILED (-2) loading 'http://localhost:49770/__launchpad/index.html'
Error: ERR_FAILED (-2) loading 'http://localhost:49770/__launchpad/index.html'
at rejectAndCleanup (node:electron/js2c/browser_init:165:7500)
at EventEmitter.stopLoadingListener (node:electron/js2c/browser_init:165:7875)
at EventEmitter.emit (node:events:527:28)
at EventEmitter.emit (node:domain:475:12)
What could be the reason for this? I have tried to stop the firewall and restart my PC but it didn't work.
https://lightrun.com/answers/cypress-io-cypress-1030-regression---test-runner-randomly-fails-when-running-electron-locally
I found a solution that worked for me. I was running the command in a cmd with admin privileges. According to this article, you need to run it in a cmd without admin rights.

POT insomnia plugin installation failed

I have installed the POT Insomnia plugin following link but it's not complete.
Here is error log:
Error: Yarn error warning #platform-of-trust/insomnia-plugin-platform-of-trust > jssha#2.4.2: jsSHA versions < 3.0.0 will no longer receive feature updates
at file:///Applications/Insomnia.app/Contents/Resources/app.asar/bundle.js:99713:16
at ChildProcess.exithandler (child_process.js:295:7)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
What would be suggested to solve this issue?
Manually install with npm:
npm i #platform-of-trust/insomnia-plugin-platform-of-trust
Make sure it is installed in plugins folder of Insomnia.
After installation is complete Reload plugins.
At least this worked for me.
You could try insomnia workspace from this PR https://github.com/PlatformOfTrust/rest-client-packages/pull/7 since it has updates for that package version
For windows 10-11 users
npm install insomnia-plugin-os
Then the plugin you wan to install for example in my case insomnia-plugin-xdebug
npm install insomnia-plugin-xdebug
Go to C:\Users\YOUR_USERNAME\node_modules
cut 3 folders
Open Insomnia->Application->Preferences->Plugins
Press Reveal Plugins Folder
Paste copied items
Open Insomnia->Application->Preferences->Plugins
Press Reload Plugins
That's it!

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 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.