As in image i have file and the path to file is also right. So why i am getting error that module not found?
I am new in ios development in react-native but have android app which work properly with same code.
-
1Try clearing your cache and run the project again gist.github.com/jarretmoses/c2e4786fd342b3444f3bc6beff32098dAndrew– Andrew2019-01-27 17:22:09 +00:00Commented Jan 27, 2019 at 17:22
-
Great. I will write a proper answer so that if others get stuck they can find it. If you can accept it that would be great.Andrew– Andrew2019-01-27 17:42:52 +00:00Commented Jan 27, 2019 at 17:42
Add a comment
|
1 Answer
A lot of errors like this can be caused by the cache not updating correctly. Like all things electronic they can be fix by restarting, the best thing to do is clear the cache and see if your problems persist.
You can clear the cache like this, just choose the one for your version or react-native, npm, or OS.
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
https://gist.github.com/jarretmoses/c2e4786fd342b3444f3bc6beff32098d
