Create-react-native-app: QR code not in terminal output

Created on 13 Jul 2017  ยท  11Comments  ยท  Source: expo/create-react-native-app

Description

After running npm start, I do not see a QR code appearing anywhere in the terminal output. I believe I have recently updated all of the necessary packages, and just started using create-react-native-app in the past week, so that is not in need of an update.

Expected Behavior

Running npm start does not output a QR code to the terminal.

Observed Behavior

I receive the following output:

> [email protected] start /Users/Nate/Desktop/Projects/Capsule
> node node_modules/react-native/local-cli/cli.js start

Scanning 752 folders for symlinks in /Users/Nate/Desktop/Projects/Capsule/node_modules (9ms)
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚  Running packager on port 8081.                                            โ”‚
 โ”‚                                                                            โ”‚
 โ”‚  Keep this packager running while developing on any JS projects. Feel      โ”‚
 โ”‚  free to close this tab and run your own packager instance if you          โ”‚
 โ”‚  prefer.                                                                   โ”‚
 โ”‚                                                                            โ”‚
 โ”‚  https://github.com/facebook/react-native                                  โ”‚
 โ”‚                                                                            โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Looking for JS files in
   /Users/Nate/Desktop/Projects/Capsule


React packager ready.

Loading dependency graph, done.
Bundling `index.ios.js`  100.0% (457/457), done.
Bundling `index.ios.js`  100.0% (603/603), done.

Environment

Please run these commands in the project folder and fill in their results:

Also specify:

  1. Operating system: MacOS Sierra 10.12.5
  2. Phone/emulator/simulator & version: iPhone running 10.3.2

Most helpful comment

it looks like your project doesn't have react-native-scripts installed either. this looks like a project that was created with react-native-init rather than create-react-native-app :)

All 11 comments

Hello! Did you eject your project by any chance?

Hi - No, I have not ejected the project, unless running react-native run-ios automatically ejects it. I just initialized a new app with create-react-native-app to confirm that this is happening on the initial npm start for a new project.

Can you paste the package.json here? It looks like the start script is set to node node_modules/react-native/local-cli/cli.js start but in all new create-react-native-app projects it is react-native-scripts start

> [email protected] start /Users/Nate/Desktop/Projects/Capsule
> node node_modules/react-native/local-cli/cli.js start

Oh, strange. I don't think I've touched the package.json config so I'm not sure how that got tweaked. I'll try changing that line to react-native-scripts start and report back.

{
  "name": "Capsule",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "expo": "^18.0.9",
    "firebase": "^4.1.3",
    "lodash": "^4.17.4",
    "moment": "^2.18.1",
    "react": "16.0.0-alpha.12",
    "react-native": "0.46.1",
    "react-native-communications": "^2.2.1",
    "react-native-router-flux": "^3.35.0",
    "react-native-scripts": "0.0.50",
    "react-native-stopwatch-timer": "0.0.19",
    "react-redux": "^5.0.5",
    "redux": "^3.7.1",
    "redux-thunk": "^2.2.0"
  },
  "devDependencies": {
    "babel-jest": "20.0.3",
    "babel-preset-react-native": "2.1.0",
    "jest": "20.0.4",
    "react-test-renderer": "16.0.0-alpha.12"
  },
  "jest": {
    "preset": "react-native"
  }
}

it looks like your project doesn't have react-native-scripts installed either. this looks like a project that was created with react-native-init rather than create-react-native-app :)

Oh. If that's the case, sorry about that! I was almost certain I had started this project using create-react-native-app, but maybe I'm mistaken. Just as an update to the above, when I changed the npm start script to react-native-scripts start I got a missing app.json error in the terminal, even though I have an app.json file in the root of the project (just has a name and displayName key in JSON)

you'd need to add this to app.json:

"expo": {
  "sdkVersion": "18.0.0"
}

that's a silly error message though, we should fix that

Just initialized a new project using create-react-native-app and I'm now seeing the QR code as expected, sorry about the confusion there! Not sure how I ever stumbled into a react-native-init product build but it appears everything is working now!

haha! excellent. glad it was resolved

Sorry for posting here I have an project that I think that it wasn't create with create-react-native-app but I want it to generate the qr code to test it on my phone is it possible ?

$npm run eject command doesn't ejecting the project even there in not any folder created of android or IOS in project diectories how can i eject the project and use in android studio ?? thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iRoachie picture iRoachie  ยท  5Comments

anp picture anp  ยท  3Comments

FezVrasta picture FezVrasta  ยท  3Comments

WeslleyNasRocha picture WeslleyNasRocha  ยท  4Comments

mwq27 picture mwq27  ยท  5Comments