npm run ios-bundle has error: Unable to resolve module ReactUpdates
ngduc opened this issue · comments
npm run ios-bundle has error: Unable to resolve module ReactUpdates
I followed this guide then it works fine.
http://stackoverflow.com/questions/40730787/unable-to-resolve-module-react-lib-reactupdates
(pinned react to: "react": "~15.3.2")
Can this be fixed? Thanks.
If you do not pin it to react 15.3.x , I had to do the following steps:
- upgrade react-native in package.json
"dependencies": {
...
"react-native": "^0.42.0",
...
},
-
run
npm install
oryarn
-
run
react-native upgrade
in terminal -
Answered
y
to all (Do you want to replace ...? questions. About 10 times.) -
make sure gradle version is updated in
android/gradle/wrapper/gradle-wrapper.properties
: changed thedistributionUrl
todistributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
-
update
index.android.js
(change the first line):
import React, { Component, AppRegistry } from 'react-native';
toimport React, { Component } from 'react'; import { AppRegistry } from 'react-native';
-
run
react-native run-ios
orreact-native run-android
ornpm run web-dev
to see the app working.
Anyone knows if there is actually something useful that has been overwritten? It didn't seem to be the case.
Alternatively I tried to react-native-git-upgrade. That changed files... but then when it patched the files reverted to the state prior to the upgrade. So the errors were not resolved.