I got a sudden error that the module 'fs' is unable to resolve. But I have not used this module nor changed anything. My App suddenly returns this error while starting.
error: bundling failed: Error: Unable to resolve module
fs
from/Path/to/Project/node_modules/handlebars/lib/index.js
: Modulefs
does not exist in the Haste module mapThis might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following:
- Clear watchman watches:
watchman watch-del-all
.- Delete the
node_modules
folder:rm -rf node_modules && npm install
.- Reset Metro Bundler cache:
rm -rf /tmp/metro-bundler-cache-*
ornpm start -- --reset-cache
.- Remove haste cache:
rm -rf /tmp/haste-map-react-native-packager-*
.
I already tried the four steps to resolve, several times but nothing helped. Any ideas what could be wrong?