大家好,我正在用 react-native 制作我的第一個應用程式,但在安裝時遇到了問題。
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)
uj5u.com熱心網友回復:
嘗試
安裝
紗線安裝
如果這是你的第一個專案。我認為您可能會開始使用 expo-cli。它類似于具有簡單作業流程的 react-native CLI。
但我建議您重新安裝/重新遵循檔案步驟。
看一下這個
https://reactnative.dev/docs/environment-setup
uj5u.com熱心網友回復:
我認為你已經從某個地方分叉或復制代碼并試圖了解事情是如何作業的。我的 js 專案我們可能有很多依賴項,這些依賴項也可能有一些依賴項,因此我們需要的模塊足夠大。雖然我們正在存盤我們的代碼或共享我們的代碼,我們基本上忽略 node_modules 檔案夾,當您運行應用程式時。首先您應該安裝所有必需的模塊。
安裝
如果你使用 npm 作為你的包管理器
紗線安裝
如果你使用 yarn 作為你的包管理器
,這些命令中的任何一個都會為你的專案安裝所需的模塊,然后嘗試運行它。快樂編碼!!!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/334949.html
標籤:javascript 反应原生
下一篇:ReactNative,reactnavigation,如何使用Drawer回傳()到上一個螢屏,而不是第一個螢屏?
