Home > Software design >  Missing package "metro-config" (React Native)
Missing package "metro-config" (React Native)

Time:10-25

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)

CodePudding user response:

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

CodePudding user response:

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!!!

  • Related