Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing package "metro-config" (React Native)

Hi guys I'm making my first app in react-native and i got a problem while installing.

Missing package "metro-config" in the project at: C:\Users\Luc\Downloads\dashboard\ToDo APP\todoList
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-config" in the project at: C:\Users\Luc\Downloads\dashboard\ToDo APP\todoList
This usually means `react-native` is not installed. Please verify that dependencies in package.json include "react-native" and run `yarn` or `npm install`.   
    at resolveFromProject (C:\Users\Luc\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\metro-config\src\importMetroFromProject.ts:19:11)        
    at importFromProject (C:\Users\Luc\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\metro-config\src\importMetroFromProject.ts:25:18)
ts:29:10)
    at getDefaultConfig (C:\Users\Luc\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\metro-config\src\ExpoMetroConfig.ts:89:23)
    at Object.loadAsync (C:\Users\Luc\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\metro-config\src\ExpoMetroConfig.ts:268:23)
    at runMetroDevServerAsync (C:\Users\Luc\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\dev-server\src\MetroDevServer.ts:58:45)
    at startDevServerAsync (C:\Users\Luc\AppData\Roaming\npm\node_modules\expo-cli\node_modules\xdl\src\start\startDevServerAsync.ts:69:55)
    at startAsync (C:\Users\Luc\AppData\Roaming\npm\node_modules\expo-cli\node_modules\xdl\src\start\startAsync.ts:74:41)
like image 237
Lucian Horvat Avatar asked Oct 28 '25 03:10

Lucian Horvat


2 Answers

I think you have forked or copied the code from somewhere and trying to learn how things work.I js projects we may have a lot of dependencies and that dependencies also may some dependencies thus the modules we require would be huge enough.While we are storing our code or sharing our code,we basically ignore the node_modules folder and when you are running the app .At first you should install all the required modules.

npm install

if you are using npm as your package manager

yarn install

if you are using yarn as your package manager
Either of these commands will install the required modules for your project and then try to run it.happy coding!!!

like image 115
Naveenkumar M Avatar answered Oct 29 '25 18:10

Naveenkumar M


Try

npm install

yarn install

if it's your first project. I think you may get started with expo-cli. It is similar to react-native CLI with a simple workflow.

But I recomend you to re-install/re-follow doc steps.

Check this out

https://reactnative.dev/docs/environment-setup

like image 25
Cihan Ekşioğlu Avatar answered Oct 29 '25 16:10

Cihan Ekşioğlu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!