After rm -rf node_modules && npm i, the problem remains the same:
Looking for JS files in
D:\Projects\Temp\TestApp\node_modules\react-native\scripts
Loading dependency graph, done.
Error: Unable to resolve module ./index from D:\Projects\Temp\TestApp\node_mo
dules\react-native\scripts/.: The module ./index could not be found from D:\
Projects\Temp\TestApp\node_modules\react-native\scripts/.. Indeed, none of thes
e files exist:
D:\Projects\Temp\TestApp\node_modules\react-native\scripts\index(.native||.
android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.t
s|.ts|.android.tsx|.native.tsx|.tsx)D:\Projects\Temp\TestApp\node_modules\react-native\scripts\index\index(.nat
ive||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.na
tive.ts|.ts|.android.tsx|.native.tsx|.tsx)package.json:
{
"name": "TestApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.1"
},
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/runtime": "^7.4.2",
"@react-native-community/eslint-config": "^0.0.3",
"babel-jest": "^24.5.0",
"eslint": "^5.15.3",
"jest": "^24.5.0",
"metro-react-native-babel-preset": "^0.53.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on Stack Overflow, or on Reactiflux. You may also use discuss.reactjs.org/ to discuss best practices.
I'm getting this same error for react-native run-ios on a Mac. It's a brand new, empty project, just created with the latest react-native cli (i.e. _not_ expo).
But the index.js file _is_ there in the root of the project, right where it should be.
I don't know why the react-native-bot has closed this as "a question". It's quite obviously an error report.
Update
I managed to get it working by following advice comment on #23908. I ran:
react-native start -- --reset-cache
in one command line window, followed by:
react-native run-ios
in _separate_ command line window.
Most helpful comment
I'm getting this same error for
react-native run-ioson a Mac. It's a brand new, empty project, just created with the latest react-native cli (i.e. _not_ expo).But the index.js file _is_ there in the root of the project, right where it should be.
I don't know why the react-native-bot has closed this as "a question". It's quite obviously an error report.
Update
I managed to get it working by following advice comment on #23908. I ran:
react-native start -- --reset-cachein one command line window, followed by:
react-native run-iosin _separate_ command line window.