Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting "Unable to resolve module `react

Tags:

react-native

enter image description herei am getting the below error.

The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false

Body:
{"from":"D:\AwesomeProject\index.android.js","to":"react","message":"Unable to resolve module react from D:\\AwesomeProject\\index.android.js: Module does not exist in the module map or in these directories:\n D:\AwesomeProject\node_modules\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start --reset-cache.","name":"UnableToResolveError","type":"UnableToResolveError","errors":[{}]}
onResponse
DevServerHelper.java:332
execute
RealCall.java:126
run
NamedRunnable.java:32
runWorker
ThreadPoolExecutor.java:1112
run
ThreadPoolExecutor.java:587
run
Thread.java:818

{"from":":\\AwesomeProject\\index.android.js","to":"react","message":"Unable to resolve module `react`
i tried every workaround given by the log still it's not working..
like image 520
Abhijit Chakra Avatar asked Sep 11 '25 14:09

Abhijit Chakra


1 Answers

Check whether the folder named react exists inside node_modules named folder or not, and if it is not there then,

stop the server and again install 'react'

 npm install react --save

after the installation please restart the sever by reseting the cache

 npm start --reset-cache

Then run your application

like image 110
Vishnu KR Avatar answered Sep 14 '25 06:09

Vishnu KR