luiquao
luiquao

Reputation: 1114

Command `bundle` unrecognized.Did you mean to run this inside a react-native project?

Run the react-native bundle command in terminal from the root directory of your app

What is the root directory of my app? I am trying to run UIExplorer (on my device) from the official repo but its always giving me this message when I run

react-native bundle

Command bundle unrecognized.Did you mean to run this inside a react-native project?

I think I tried pretty much every directory inside /react-native-master

Upvotes: 2

Views: 6379

Answers (2)

Shivam Goswami
Shivam Goswami

Reputation: 1

open cmd go project dir and run git bash show Command bundle unrecognized. bat cmd does not show an error

Upvotes: 0

Indra Adam
Indra Adam

Reputation: 269

You don't need to run react-native bundle.

You should follow the 'OPTION 2' instruction in AppDelegate.m, you will find something like the screenshots below: enter image description here

The instruction in the React-native website is not so clear, a clearer instructions will be:

  • Open iOS/AppDelegate.m
  • Comment out jsCodeLocation = [NSURL
    URLWithString:@"http://localhost:8081/index.ios.bundle"];
  • Uncomment jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  • Run the curl given in 'OPTION 2' (e.g. http://localhost:8081/index.ios.bundle -o main.jsbundle)
  • if this fails add the --ipv4 flag to the end of it.
  • In XCode, right click on your project directory and click Add Files to "Project Name Here" - choose the main.jsbundle file that
    you generated.

Referenced from: https://github.com/facebook/react-native/issues/240

If you still can't run it, check your main.jsbundle if it contains error. If it does, make sure the given curl path is correct. I end up changing the curl to curl http://localhost:8081/Examples/UIExplorer/UIExplorerApp.ios.bundle -o main.jsbundle in order for it to work.

Upvotes: 4

Related Questions