Rowkaha
Rowkaha

Reputation: 103

Missing package "metro" in the project at D:\ReactNative\FirstProject

Missing package "metro" in the project at D:\ReactNative\FirstProject. This usually means react-native is not installed. Please verify that dependencies in package.json include "react-native" and run yarn or npm install. Error: Missing package "metro" in the project at D:\ReactNative\FirstProject. This usually means react-native is not installed. Please verify that dependencies in package.json include "react-native" and run yarn or npm install.

enter image description here

Upvotes: 8

Views: 22141

Answers (12)

Saintilien Wilson
Saintilien Wilson

Reputation: 51

installing expo and expo start working for me.

Upvotes: 0

Shamxeed
Shamxeed

Reputation: 422

I experienced the same issue, I'm using expo managed workflow, and cleaning cache has worked for me.

expo r -c is the command I used.

Upvotes: -1

Ankesh Kumar
Ankesh Kumar

Reputation: 31

I was getting the same problem, after running 'npm install --global expo-cli' it solved the issue or you can run npm install

Upvotes: 3

JimiA
JimiA

Reputation: 87

You are getting this problem based on how you created the program. So, when I created it from the terminal, following this instruction: https://reactnative.dev/docs/environment-setup it worked, but when I tried to create the program inside of the terminal in an existing project, I got the error.

Upvotes: 0

bello oladepo
bello oladepo

Reputation: 21

try to start the project from main folder created by expo init. i.e opening the project folder directly on you visual studio

Upvotes: 1

Omar Jribi
Omar Jribi

Reputation: 99

you don't really need to delete node_modules folder.

just update it by typing:

1/ npm : npm install

or

2/ yarn : yarn install

in your terminal. That will update the node_modules folder content as well as creating all missing files without the need to reinstall it from scratch.

Upvotes: 9

ABHISHEK ROY
ABHISHEK ROY

Reputation: 21

Try Using npm i metro

Worked for me

Upvotes: 2

Nitin Patel
Nitin Patel

Reputation: 109

I had this issue after installing @react-native-community/hooks

You don't need to delete any node_modules folder.

Installing react-native again solved the problem for me.

npm i react-native

Upvotes: 2

Raphael Soares
Raphael Soares

Reputation: 1

It happened to me when you tried install @react-native/bottom-tabs. But I've installed this package with npm, so I removed this package and installed it again with yarn and it fix my problem with no need to remove node_modules.

Upvotes: 0

omarbirjas
omarbirjas

Reputation: 33

I had this issue after I installed react-native-svg

Maybe there is some sort of naming conflict is causing this error? Deleting node_modules and running npm install again fixed it for me.

Upvotes: 3

maxwellsr
maxwellsr

Reputation: 3051

I had the same issue after installing

react-native-paper

After follow this steps all worked again

  1. Remove node_modules folder.

  2. Install all dependencies again, run npm install. If show any error Remove package-lock.json.

  3. Run npm start again.

Happy coding.

Upvotes: 14

user14866434
user14866434

Reputation: 61

I deleted the folder "node_modules" then run "npm install" again. It worked for me.

Upvotes: 6

Related Questions