Module `#react-navigation/core` does not exist in the Haste module map - react-native

i've have a weird one with a react native project running both react-navigation and redux.
i need to add this package:
https://github.com/react-navigation/react-navigation-redux-helpers
i ran:
npm install react-navigation-redux-helpers
then added this line to my code:
import { createNavigationReducer } from 'react-navigation-redux-helpers';
now whenever i run the project, it fails to compile with this error:
Module `#react-navigation/core` does not exist in the Haste module map
Anyone ran into something like this before?
I've tried removing node_modules folder and package.lock file. then I tried clearing Watchman and NPM cache

Remove the node_modules folder and react-navigation-redux-helpers from package.json.
Go to the root directory of the project and remove the current node modules and install again.
rm -rf node_modules npm install

Related

Module not found: Can't resolve '#react-icons/all-files' in gatsby sanity project

I'm using sanity and gatsby for my project
after I installed react-icons with these command
npm install #react-icons/all-files --save
and import some icons to my project
import { BiHomeSmile } from "#react-icons/all-files/bi/BiHomeSmile";
and run npm run dev i'll get this error
Module not found: Can't resolve '#react-icons/all-files'
but it will gone when I'm using this
import { BiHomeSmile } from "../../node_modules/#react-icons/all-files/bi/BiHomeSmile";
i clean gatsby cach or run npm install it didn't work and I'm unable to remove node module folder if i delete it my project fail to build and run again i dont know why but it didnt worth to delete this folder and run npm install again
first use gatsby clean to remove cache folder next uninstall react-icons module
npm uninstall #react-icons/all-files
install react-icons package throw root permission
sudo npm install #react-icons/all-files --save

Unable to resolve module `buffer` from react-native-ssdp

I am facing unable to resolve module 'buffer' from react-native-ssdp.Any one knows how to fix this issue. React native version
react-native-cli: 2.0.1
react-native: 0.58.5/0.59.8
I have tried
1. Clear watchman watches: watchman watch-del-all.
2. Delete the node_modules folder: rm -rf node_modules && npm install.
3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
So, after digging into the component, I found that buffer and other components required by the package are under the peer dependency section of the package.json file.
This means they will not be installed locally for the package, but rather depend on what is installed in your main package.
The quickest fix was installing these packages which are required by the package.
Note that there are several such packages out there that have probably the same exact code such as react-native-ssdp, react-native-ssdp-grok and react-native-upnp.
The same solution will work for any of them.
Install these:
react-native-udp, buffer, and react-native-network-info.
Check the module's package.json for the specific requirements.

error: bundling: UnableToResolveError: Unable to resolve module react/lib/ReactComponentTreeHook

Why? Why is react looking here? I have another test android project and it also does not have react package located there, yet it runs perfectly. Why is this one looking here? The only difference is I first did setup a directory below. In MyProject/App is where i did the init. I then moved the index.js files and package.json a level up to top level directory. I want to know the WHY of this error!
Here is the error:
error: bundling: UnableToResolveError: Unable to resolve module
react/lib/ReactComponentTreeHook from /Users/Admin/Projects/MyProject/node_modules/react- native/Libraries/Performance/Systrace.js:
Module does not exist in the module map or in these directories:
/Users/Admin/Projects/MyProject/node_modules/react- native/node_modules/react/lib
, /Users/Admin/Projects/MyProject/node_modules/react/lib
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset packager cache: rm -fr $TMPDIR/react-* or `npm start --reset-cach
All these steps I have tried. They don't fix it. I will probably do another init a level above but still I want to know whey it's looking there. Is there a module map being setup somewhere incorrectly? Where do I look for this?
UPDATE: After doing init properly in the root directory of the app I now get something else:
Loading dependency graph, done.
error: bundling: UnableToResolveError: Unable to resolve module react/lib/ReactDebugCurrentFrame from /Users/Admin/Projects/MyProjectRoot/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js: Module does not exist in the module map or in these directories:
This leads to suggestions that you need alpha version of react to go along with latest react:
https://github.com/facebook/react-native/issues/13017
But doing this does not work. It just leads back to the same issue I had to begin with about ReactComponentTreeHook.
Again, same suggestions about how to fix it. rm -rf node_modules followed by npm install! But I also did a npm install --save on react react-native. I think I need some response from react-native team on how to properly interpret this kind of error. What's going on here?
Xcode 8.2 still occur same error. Three lines bellow fixed it for me :)
Downgrade react(16.0.0-alpha.12 -> 16.0.0-alpha.6) & react-native(0.45.0 -> 0.44.0)
rm -rf node_modules/react
npm i react#16.0.0-alpha.6 -S
npm i react-native#0.44.0 -S
Then run react-native run-ios
Hope this help.
The problem is that the npm init, npm install --save react -react-native does not install the correct versions. What you need to do is look at the version of react inside package.json In my case it was an alpha.
So right now need to do:
npm install --save react#16.0.0-alpha.6 react-native
but check what's inside your package.json and watch any warning messages carefully
Try install react-native-git-upgrade
$ npm install -g react-native-git-upgrade
and then run
$ react-native-git-upgrade
for me it works.
This error happens when someone upgrade react-native version.
$ npm install -g react-native-git-upgrade
$ npm install react-native#latest --save
$ react-native-git-upgrade
Close all terminals.
Then clear cache. Remove directory ~/Library/Developer/Xcode/DerivedData
In Xcode, Product-> Clean
Then run simulator from Xcode or run code on the attached device again.

I am getting "Unable to resolve module `react

i 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..
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
Try
npm install
hopefully this resolve
There is a problem with the node module i had to remove the node module and add then i had to downgrade the the React-Native Library and Run the command react-native start and then react-native run-android after that it worked for me.

Requiring unknown module "ReactInstanceHandles"

Recently updated to React 0.19.0 and have started to get this error.
I've tried cleaning out the gradle folders but I'm still getting the error.
I've also tried restarting the package manager.
I fixed this by
rm -rf node_modules
Remove react from package.json, since react-native now includes it.
npm install