Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native.js: Unable to find this module in its module map or any of the node_modules directories #7686

Closed
jamesone opened this issue May 23, 2016 · 10 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jamesone
Copy link

I've just upgraded to RN 0.26.1, all the xCode is fine without any errors, but when it comes to starting the simulator it throws the following error:

2016-05-23 13:49:49.714 [fatal][tid:main] Unable to resolve module ReactNative from /Users/james/apps/xxxNEW/node_modules/react-native/Libraries/react-native/react-native.js: Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/ReactNative and its parent directories

Now I went ahead and looked at the node_modules/react-native/Libraries/react-native/react-native.js file, it's there.

Just to mention I've cleared the watches, deleted and re-installed the node_modules, and cleared the package cache, and I'm still getting the same error!

Any ideas to why this is happening?

I should also add that I'm using cocoa pods for the fbsdk kit (not sure this matters though).

@jmurzy
Copy link
Contributor

jmurzy commented May 23, 2016

This is caused by a breaking change in 0.26.

React API must be now required from react package (previously a warning on 0.25)

@jamesone
Copy link
Author

@jmurzy - I'm unsure whether this is the issue. I've gone through all my modules and checked that the imports are valid (is their a way to double check this?), the error doesn't say which file has the import issue?!

@rlau1115
Copy link

+1

@Alexintosh
Copy link

Same problem here, already requiring everything from the react.

@jamesone
Copy link
Author

@Alexintosh - If you come across a fix, post it here!

@fov42550564
Copy link

+1

@jamesone
Copy link
Author

jamesone commented May 23, 2016

I found out what was wrong. You must have React version 15.0.2 installed. npm i --save react@15.0.2. I had an older version of react, which is why the app was throwing this error.

If this doesn't fix the issue for you guys, then double check all your imports follow the new react-native rules, this includes all your package.json modules.

@toddmetheny
Copy link

@jamesone Is there a link somewhere to the new react-native rules?

@rodolph66
Copy link

While doing tutorials which require npm installs mid way, after almost every npm install I had this error come up.
Unable to find this module in its module map or any of the node_modules...etc
One solution I read in another blog/forum replaced the version number of the module in the package.json with a link to the github of the module. This seemed to work, provided the node_modules folder is deleted and re-built with npm install.
Then I noticed then when the npm module gets installed with a version number using a caret ( i.e. "redux" : "^3.5.0" ) it causes this same error. Then I started either removing the caret and re-installing the node_modules or npm install a specific version so as not to have the caret sign, and I no longer get this error...!!!!

@SaikCaskey
Copy link

rodolph66's suggestion fixed my issue with semantic-ui and create-react-app

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants