javascript - Missing package "metro-config" (React Native) - Stack Overflow

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

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)

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)
Share Improve this question asked Oct 23, 2021 at 18:35 Lucian HorvatLucian Horvat 431 gold badge1 silver badge5 bronze badges 2
  • 1 could you run npm list in your project directory and see if react-native is in there ? – Coffeeholic Commented Oct 23, 2021 at 18:45
  • hey, i needed to install react native lmao. – Lucian Horvat Commented Oct 23, 2021 at 21:39
Add a ment  | 

2 Answers 2

Reset to default 2

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 mands will install the required modules for your project and then try to run it.happy coding!!!

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 reend you to re-install/re-follow doc steps.

Check this out

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744232735a4564331.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信