New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Unable to resolve module ./index
from \node_modules\react-native\scripts/.
: The module ./index
could not be found from \node_modules\react-native\scripts/.
. Indeed, none of these files exist:
#23908
Comments
Can you run If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.
|
@moinulhuq! Yeah I have been the same :(. |
same issues |
I restore my project and use new new method to upgrade: |
NOTE: One difference between my error and OP's is I'm unable to resolve the module I'll second this. After upgrading from
I can't imagine it's an issue with specific Android/iOS config and build files since I get the same error across platforms, but I can provide them if necessary. My gradle version is I've taken the usual steps when encountering a problem while updating RN:
No luck so far, any help would be appreciated. |
same issue + 1 |
After creating a new project using React-native 0.59 , i copied |
the issue only happens when I press |
Could be because the cache directory already changed |
run works fine for me, maybe just for a temporary solution. there is another solution from @nazreinkaram by updating |
I have the same issue. Have you found the solution? |
Thanks you. I tried and success :). Everyone can try |
I get the same issu on IOS, if i remove debug mode the app start. but need debug. any idea ? thanks |
I just copied |
can someone past the content and path of the I have one in
|
Hello everyone - this issue seems to be related to your experience upgrading between versions. We know this has been a long lasting pain for the community so starting v0.59 we have introduced a new flow via the new CLI. But, to upgrade to that version, you still need some potentially manual steps - we suggest you use the rn-diff-repo to accomplish this. Given that this is not strictly a bug with the library itself I'll close this, but if someone can create a repro that has this issue with a freshly created @alainib you can use the one in https://github.com/facebook/react-native/tree/0.59-stable/template |
Thanks @kelset! It took me a while to fix this. Like @saraztr and others said, copying metro.config.js from a 0.59 new project fixes the issue. @alainib , here's the metro.config.js content:
|
same issues Error: Unable to resolve module React Native Environment Info: Environment : |
@VivekkChudasama try to
|
@VivekkChudasama WHat do you mean by put the metro.config.js posted before? |
@ahmad6242, create a new file in your RN project root folder named metro.config.js with the content below: /**
module.exports = { |
I tried cleaning the cache, removing the node_modules directory and reinstalling using |
did you have last metro in dev dependancies ? |
Same issue, I even tried a new app from scratch without changing anything and I got the same error...
|
And i have same issue, with new app: |
info |
i can confirm this works and fixes the issue run |
I have same issue , When I upgrade to 0.59.2 , I must always put |
Updated status as of now, Using the newest version 0.59, I am able to fire up new vanillla project without error. |
I got this problem few days ago. today after erasing node_modules it get back I have metro.config.js as posted above i tried :
I give me this error now :
"react-native": "0.59.2" |
@alainib update to latest version |
i tried ( failled completly )
|
it finally worked thank you
|
Thanks, @Souradeep-16
|
This worked for me for 0.59.0. However, is this fixed in a higher version of RN. |
I tried upgrading to 0.59.0 faced the same issue, later upgraded to 0.59.9 solved this issue. |
Using latest 0.59.10 - fresh project - moving App.js, app.json and index.js into a src folder. Setting projectRoot as src is ignored. |
it looks it is permanently broken, only thing that temproray works is this #23908 (comment) i dont know how the error happened, i had some errors with iOS pods first, then i ran yarn install and also npm install (maybe mistake to run both but probably its not the reason), i even deleted problematic folder in ios pods, didnt help, then i ran lot of commands like rm -rf node_modules, npm install etc nothing helped then the error as stated by the thread starter happened. so something somewhere is still broken. EDIT: updating "react-native": "0.59.1", to "react-native": "0.59.10", seems to fix the error. |
Those steps except the last 2 fix the issue that arise after I installed exios lib.
|
I think from RN version 0.59.0 you have to manually start the server run react-native start And then open another terminal and then run react-native run-android previous version automatically starts the development server. But I think there is a change from RN 0.59.0 upwards. The above was what worked for me |
Hey, were you able to solve it? I'm under the same issue :S |
It's a liar. That file does indeed exist! Since my React Native test runner is nested inside an examples directory of the main module repo. I have a
If you follow the recommendation to I don't know if this causes other problems, but this is how I got my project working again:
Update: Actually I'm back to square one. It broke again when I ran |
I updated to this
And started workinng again. |
So with the release of 0.59, the debugging process of an RN app is even more painful than it already was? What a load of crap this development platform is. I can't believe it even exists, let alone the morons who choose it for their projects. I have no choice, I'm stuck with existing projects that I have to support. Compare it with Xamarin: To debug in either platform, you press the Play button. That's it. |
For some reason, none of these worked for me. Hoping to find a better solution... |
I got the same issue when I updated my app react-native version. I deleted the node_modules file and ran the |
This worked for me. |
I had put my hook useDispatch outside of my function component... maybe it can help someone |
Was only getting this issue on android, I had changed my entry file in System: |
🐛 Bug Report
I am getting this error when upgrade my react native.
It says
Error: Unable to resolve module ./index from \node_modules\react-native\scripts/.: The module ./index could not be found from \node_modules\react-native\scripts/.. Indeed, none of these files exist:
To Reproduce
react-native run-android
Expected Behavior
Should run the App
Code Example
{
"name": "RedCrow",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"axios": "^0.18.0",
"leaflet": "^1.4.0",
"moment": "^2.24.0",
"native-base": "^2.12.1",
"node-pre-gyp": "^0.12.0",
"prop-types": "^15.7.2",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-leaflet": "^2.2.1",
"react-native": "^0.59.0",
"react-native-camera": "^1.13.1",
"react-native-fs": "^2.13.3",
"react-native-gesture-handler": "^1.1.0",
"react-native-image-crop-picker": "^0.22.0",
"react-native-image-picker": "^0.28.0",
"react-native-modal": "^7.0.2",
"react-native-vector-icons": "^6.4.1",
"react-native-video": "^4.4.0",
"react-native-webview": "^5.3.0",
"react-native-webview-leaflet": "^4.1.22",
"react-navigation": "^3.3.2",
"react-navigation-props-mapper": "^0.3.0",
"react-redux": "^6.0.1",
"realm": "^2.25.0",
"redux": "^4.0.1",
"redux-form": "^8.1.0",
"rn-fetch-blob": "^0.10.15",
"util": "*"
},
"devDependencies": {
"babel-jest": "^24.5.0",
"jest": "^24.5.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
Environment
"react": "^16.8.4",
"react-native": "^0.59.0",
The text was updated successfully, but these errors were encountered: