Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 777
Rowkaha Avatar asked Dec 18 '20 05:12

Rowkaha


People also ask

What is Metro in react native?

Metro is a development platform for React Native. This project acts as a JavaScript bundler; it manages assets, caches builds and performs hot module reloading. Watch the video. Metro focuses on improving the developer experience for the React Native community.


Video Answer


5 Answers

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.

like image 135
skyllet Avatar answered Oct 09 '22 08:10

skyllet


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.

like image 21
Omar Jribi Avatar answered Oct 09 '22 08:10

Omar Jribi


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

like image 6
user14866434 Avatar answered Oct 09 '22 08:10

user14866434


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.

like image 3
omarbirjas Avatar answered Oct 09 '22 09:10

omarbirjas


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

like image 3
Ankesh Kumar Avatar answered Oct 09 '22 09:10

Ankesh Kumar