profile
viewpoint

Ask questionsCould not debug - error code 604

Actual Behavior

  1. run VSCODe
  2. try to debug on iOS or Android 3 .
Could not debug. Seems to be that you are trying to debug from within directory that is not a React Native project root. 
 If so, please, follow these instructions: https://github.com/Microsoft/vscode-react-native/blob/master/doc/customization.md#project-structure. (error code 604)

4 - after I removed rn cli from global :

******** Unhandled error in debug adapter - Unhandled promise rejection: Error: spawn react-native ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Could not debug. Seems to be that you are trying to debug from within directory that is not a React Native project root. 
 If so, please, follow these instructions: https://github.com/Microsoft/vscode-react-native/blob/master/doc/customization.md#project-structure. (error code 604)

Screen Shot 2019-10-29 at 10 50 03 AM

Screen Shot 2019-10-29 at 10 53 20 AM

Expected Behavior

  1. just run as normal as before

Software versions

  • React-Native VS Code extension version: latest - 0.12.1
  • VSCode version: latest - 1.39.2
  • OS platform and version: mac - latest - 10.15
  • NodeJS version: latest - 12.12.0
  • React Native version: 0.61.2
  • Expo SDK version (include if relevant): -
microsoft/vscode-react-native

Answer questions ramyareye

this is react native log

[Info] Starting Packager

┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│  Running Metro Bundler on port 8081.                                         │
│                                                                              │
│  Keep Metro running while developing on any JS projects. Feel free to        │
│  close this tab and run your own Metro instance if you prefer.               │
│                                                                              │
│  https://github.com/facebook/react-native                                    │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

Looking for JS files in
   /Users/.../project 

[Info] Packager started.

[Info] Prewarming bundle cache. This may take a while ...

[Info] About to get: http://localhost:8081/index.bundle?platform=ios

Loading dependency graph, done.
 BUNDLE  [ios, dev] ./index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1535/1535), done.

[Warning] The Bundle Cache was prewarmed.

[Info] Building and running application.

[Error] Error: Error while executing command '/.../project/node_modules/.bin/react-native run-ios --simulator --no-packager --verbose': Error while executing command '/.../project/node_modules/.bin/react-native run-ios --simulator --no-packager --verbose' (error code 101)

react-native run-ios

[Info] Starting React Native Packager.

info Found Xcode workspace "seeko.xcworkspace"
error Could not find "iPhone X" simulator

I think plugin is trying react-native run-ios right ? you may add an option to channge it to npx react-native run-ios

useful!
source:https://uonfu.com/
Github User Rank List