I'm trying to run the command "npx react-native start" and shows this error
error Cannot find module '@expo/metro-config'
Require stack:
- D:\Projetos\apporto\metro.config.js
- D:\Projetos\apporto\node_modules\cosmiconfig\node_modules\import-fresh\index.js
- D:\Projetos\apporto\node_modules\cosmiconfig\dist\loaders.js
- D:\Projetos\apporto\node_modules\cosmiconfig\dist\createExplorer.js
- D:\Projetos\apporto\node_modules\cosmiconfig\dist\index.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\tools\config\readConfigFromDisk.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\tools\config\index.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\commands\install\install.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\commands\index.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\index.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\bin.js
Error: Cannot find module '@expo/metro-config'
Require stack:
- D:\Projetos\apporto\metro.config.js
- D:\Projetos\apporto\node_modules\cosmiconfig\node_modules\import-fresh\index.js
- D:\Projetos\apporto\node_modules\cosmiconfig\dist\loaders.js
- D:\Projetos\apporto\node_modules\cosmiconfig\dist\createExplorer.js
- D:\Projetos\apporto\node_modules\cosmiconfig\dist\index.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\tools\config\readConfigFromDisk.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\tools\config\index.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\commands\install\install.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\commands\index.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\index.js
- D:\Projetos\apporto\node_modules\@react-native-community\cli\build\bin.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (D:\Projetos\apporto\metro.config.js:1:30)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
I try to use the npm i metro-config --save-dev
but doesn't work.
I don't know what to do.
#################### package.json ###############################
{ "name": "apporto", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-community/async-storage": "^1.12.1", "@react-native-community/geolocation": "^2.0.2", "@react-native-community/masked-view": "^0.1.10", "@react-navigation/bottom-tabs": "^5.11.9", "@react-navigation/native": "^5.9.4", "@react-navigation/stack": "^5.14.4", "react": "17.0.1", "react-native": "0.64.0", "react-native-gesture-handler": "^1.10.3", "react-native-permissions": "^3.0.1", "react-native-reanimated": "^2.1.0", "react-native-safe-area-context": "^3.2.0", "react-native-screens": "^3.1.1", "react-native-svg": "*", "react-native-svg-transformer": "^0.14.3", "react-native-swiper": "^1.6.0", "styled-components": "^5.2.3" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "7.14.0", "jest": "^26.6.3", "metro-config": "^0.64.0", "metro-react-native-babel-preset": "^0.64.0", "react-test-renderer": "17.0.1" }, "jest": { "preset": "react-native" } }
package.json
file contents – Cornel Raiu