baumli
baumli

Reputation: 471

Trying to build a create-react-app project with expo, throws error about react-native

I've created my react app using create-react-app, and was trying to use expo, but its throwing errors when I try and build it using expo build:android:

Error: Can't find react-native in package.json dependencies
Error: React Native is not installed. Please run `npm install` in your project directory.

Do I need to start over with a react-native project, or is there a way to continue on and get this project published?

Upvotes: 1

Views: 587

Answers (2)

DavidR2106
DavidR2106

Reputation: 132

Try this:

  • Remove node_modules folder.
  • run "yarn install".
  • run "expo start".

This looks like a similar issue on this github error

https://github.com/expo/expo-cli/issues/248

Upvotes: 0

JeromeBu
JeromeBu

Reputation: 1159

I suggest you create your project using the expo docs :

npm install expo-cli --global

expo init my-new-project
cd my-new-project
expo start

Upvotes: 1

Related Questions