Project was working fine before I had to reinstall everything on my computer. I get the following error after I run npm install
and then expo start
internal/modules/cjs/loader.js:296
throw err;
^
Error: Cannot find module '/home/amber/Documents/GitKraken/school-notification-1/App/node_modules/@react-native-community/cli/build/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:288:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:515:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:759:27)
at Function.Module._load (internal/modules/cjs/loader.js:677:27)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object.<anonymous> (/home/amber/Documents/GitKraken/school-notification-1/App/node_modules/react-native/local-cli/cli.js:12:11)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32) {
code: 'MODULE_NOT_FOUND',
path: '/home/amber/Documents/GitKraken/school-notification-1/App/node_modules/@react-native-community/cli/package.json',
requestPath: '@react-native-community/cli'
}
Metro Bundler process exited with code 1
This is my package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^10.0.3",
"@react-navigation/web": "^1.0.0-alpha.9",
"axios": "^0.19.0",
"expo": "^34.0.1",
"expo-asset": "^6.0.0",
"expo-constants": "^6.0.0",
"expo-font": "~6.0.0",
"expo-web-browser": "6.0.0",
"navigationbar-react-native": "0.0.5",
"qs": "^6.8.0",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
"react-native-action-button": "^2.8.5",
"react-native-anchor-carousel": "^3.1.1",
"react-native-app-intro-slider": "^3.0.0",
"react-native-calendars": "^1.210.0",
"react-native-circle-drawer": "^1.0.0",
"react-native-drawer-menu": "^0.2.5",
"react-native-elements": "^1.1.0",
"react-native-gesture-handler": "^1.3.0",
"react-native-global-props": "^1.1.5",
"react-native-htmlview": "^0.15.0",
"react-native-loading-spinner-overlay": "^1.0.1",
"react-native-popup-dialog": "^0.18.3",
"react-native-side-drawer": "^1.1.11",
"react-native-side-menu": "^1.1.3",
"react-native-sidebar": "^0.3.0",
"react-native-web": "^0.11.4",
"react-navigation": "^3.11.0"
},
"devDependencies": {
"babel-preset-expo": "^6.0.0",
"jest-expo": "^34.0.0"
},
"private": true
}
Install this package.
npm i @react-native-community/cli
use npm install @react-native-community-cli and run again, otherwise delete the package-lock.json and node_modules ,install npm again and please clean first before run the project
Deleted package-lock.json
and node_modules
, and then reran npm install
and it works fine now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With