Create-react-native-app: New app not running in simulator

Created on 28 Apr 2018  ยท  16Comments  ยท  Source: expo/create-react-native-app

Description

Created a new app but cannot get it to run via iOS simulator.

Expected Behavior

What action did you perform, and what did you expect to happen?

yarn ios
expected simulator to run app but get an error message.

Observed Behavior

What actually happened when you performed the above actions?

get these warnings on creating the app:
warning "expo > [email protected]" has incorrect peer dependency "react-native@^0.51 || ^0.52 || ^0.53 || ^0.54".
warning "react-native > [email protected]" has unmet peer dependency "eslint@^3.17.0 || ^4.0.0".
warning "jest-expo > [email protected]" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-0".

Console reads this after 'yarn ios':
17:14:52: Warning: 'react' peer dependency missing. Run npm ls in /Users/Gavin/Desktop/myapp to see full warning.
17:14:52:
17:14:52: If there is an issue running your project, please run npm install in /Users/Gavin/Desktop/myapp and restart.

Console reads this after 'npm ls':
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! extraneous: [email protected] /Users/Gavin/Desktop/test_app/node_modules/node-pre-gyp
npm ERR! extraneous: [email protected] /Users/Gavin/Desktop/test_app/node_modules/websql
npm ERR! missing: websql@https://github.com/expo/node-websql/archive/18.0.0.tar.gz, required by [email protected]
npm ERR! peer dep missing: react-native@^0.51 || ^0.52 || ^0.53 || ^0.54, required by [email protected]
npm ERR! peer dep missing: eslint@^3.17.0 || ^4.0.0, required by [email protected]

Environment

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

[email protected]
[email protected]
[email protected]
v8.4.0
4.6.1
1.5.1
"version": "4.9.0"

Also specify:

  1. Operating system: macOS High Sierra 10.13.4
  2. Phone/emulator/simulator & version: Simulator Version 10.0
moving-to-expo-cli

Most helpful comment

I tried again from zero, but i removed expo from simulator. Got the same warning but now it runs on the simulator.

All 16 comments

I have a similar problem on android. Later i'll provide more info. Also, i tried npm install, and the warning is out but still cannot load on emulator.

I tried again from zero, but i removed expo from simulator. Got the same warning but now it runs on the simulator.

@nicoceledon thanks, just done the same. Still getting warnings but the app is now building and running. Thanks very much!

Same problem. How do I start again at zero (rm -rf folder, re-init folder?)

I had the same problem. here's what seems to work:

Uninstall yarn (this may not be necessary)
roll back npm to version 4.6.1
install [email protected]
install [email protected]
add the installs to json file to silence extraneous warning
now the only error you should be left with is:

npm ERR! peer dep missing: react-native@^0.51 || ^0.52 || ^0.53 || ^0.54, required by [email protected]
which is a problem with the react-native-maps package used for working with maps not the js function map

@rss81 So did your steps solve the react-native@^0.51 || ^0.52 || ^0.53 || ^0.54, required by [email protected] issue. It's not 100% clear to me

no, the problem is if you install 0.54 then you have a lot of problems as the build with expo require 0.55

yes. I think the problem is in the react-native-maps package that needs to be updated...?

i registered an open issue on the package, now we just need to wait

I'm experiencing the same problem as described in first post - If I use yarn to install dependencies.However If I use npm to install dependencies and start server, I only get error related to the react-native-maps.

npm ERR! peer dep missing: react-native@^0.51 || ^0.52 || ^0.53 || ^0.54, required by [email protected]

https://github.com/react-community/react-native-maps/issues/2259

if you're using Expo, Update to a new version. same applies to the simulator, Delete the Expo client app from the simulator, and redownload from the command line yarn run ios.
You can follow this link if you are having troubles in installation : https://docs.expo.io/versions/latest/introduction/installation

You can also use Expo XDE, it will automatically update the Expo client for the simulator.

@tonjack
Unfortunately did not work for me on an entirely blank system:

thomas@rethina ;) npm install react-native-maps --save

/Users/thrabe/test1
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”€ UNMET PEER DEPENDENCY react-native@^0.51 || ^0.52 || ^0.53 || ^0.54
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”ฌ UNMET PEER DEPENDENCY [email protected] invalid
โ”‚ โ””โ”€โ”€ UNMET PEER DEPENDENCY eslint@^3.17.0 || ^4.0.0
โ””โ”€โ”ฌ [email protected]
  โ””โ”€โ”ฌ [email protected]
    โ””โ”€โ”€ [email protected]

I had Warning: 'react' peer dependency missing. Run npm ls warning. This was my package.json file.

"dependencies": {
    "expo": "28.0.0",
    "react": "16.4.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz",
    "react-navigation": "2.6.2",
    "tslib": "1.9.3"
  },
  "devDependencies": {
    "@types/expo": "27.0.6",
    "@types/expo__vector-icons": "6.2.2",
    "@types/fbemitter": "2.0.32",
    "@types/react": "16.4.1",
    "@types/react-native": "0.56.1",
    "@types/react-navigation": "2.0.11",
    "exp": "55.0.5",
    "react-native-typescript-transformer": "1.2.10",
    "tslint": "5.10.0",
    "tslint-eslint-rules": "5.3.1",
    "tslint-react": "3.6.0",
    "typescript": "2.9.2"
  }

It is fixed when react and @types/react are downgraded.

yarn add [email protected]
yarn add @types/[email protected]

In my case downgrading packages helped. Just hit npm install and check carefully what peer version your package needs and what version you project uses. In my case I had to download older verion of react.

Deleting the node_modules and running yarn install instead of npm install solved the problem for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tonyhb picture tonyhb  ยท  5Comments

andyvanosdale picture andyvanosdale  ยท  3Comments

Hareesh007 picture Hareesh007  ยท  4Comments

THPubs picture THPubs  ยท  4Comments

WeslleyNasRocha picture WeslleyNasRocha  ยท  4Comments