0
votes

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

2

2 Answers

2
votes

Run yarn or npm without sudo, because when you enable devtools it's tries opening chrome by command (chrome won't open with sudo)

-1
votes

You can do it open google chrome and hit this url http://localhost:8081/debugger-ui
open console tab to debug

Disable Chrome cache

  1. Right-click chrome
  2. Go to 'inspect element'
  3. Look for the 'network' tab somewhere at the top. Click it.
  4. Check the 'disable cache' checkbox.

Reference : react-native-debugging

enter image description here