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).
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)
@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?!
+1
Same problem here, already requiring everything from the react.
@Alexintosh - If you come across a fix, post it here!
+1
I found out what was wrong. You must have React version 15.0.2 installed. npm i --save [email protected]. 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.
@jamesone Is there a link somewhere to the new react-native rules?
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...!!!!
rodolph66's suggestion fixed my issue with semantic-ui and create-react-app
Most helpful comment
I found out what was wrong. You must have
Reactversion15.0.2installed.npm i --save [email protected]. 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-nativerules, this includes all yourpackage.jsonmodules.