react-native: "Unable to resolve module" from dependency
In this case, I am requiring request-promise
, but when I start the react native project, I get the error:
Unable to resolve module x. If you are sure the module is there, try restarting the packager.
This error is reported for many of the required dependencies of the request
dependency of request-promise
. I have restarted the packager as well as removing node_modules
and reinstalling. In general, what does this error stem from and in the specific, what can be done to solve it?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 15 (5 by maintainers)
Commits related to this issue
- Upgrade react native to 0.16 Had to follow steps here: https://github.com/facebook/react-native/issues/3874#issuecomment-164078084 — committed to dukechronicle/chron-react by themichaellai 9 years ago
Hey everyone, can you all try:
watchman watch-del-all
rm -rf $TMPDIR/react-native-packager-*
And let me know if that fixes the issue?
Node core modules cannot be used inside React Native as it’s a completely different environment. closing this.
I came here after having trouble importing the a Wordpress REST API wrapper for node.js. I had the same issue with
unable to resolve module url
. I took inspiration from a similar issue and solved it by runningnpm install --save url
(and subsequentially installing a package namedutil
as well).As @satya164 pointed out, this will probably not work for all missing modules, but in my case it was only
url
andutil
and works now.Pay attention to the react error screen to find out what other modules are missing.
My development is stuck at this error. i have researched a lot on this but i found no perfect solution for this! Moreover , it is quite surprising to find an issue not resolved for the span of more than a year.
please guys, do share if you find any solution for this.