File tree Expand file tree Collapse file tree 1 file changed +0
-51
lines changed
Expand file tree Collapse file tree 1 file changed +0
-51
lines changed Original file line number Diff line number Diff line change @@ -171,55 +171,4 @@ JMessageModule.addFriend(inputTxt).then((result) => {
171171 console.log(e);
172172 });
173173```
174- ## 关于升级React Native
175174
176- ** 进入当前项目的目录**
177-
178- - 在命令行中使用:
179-
180- > react-native --version
181-
182- 就可以查看当前使用的版本
183-
184- - 在命令行中输入:
185-
186- > npm info react-native
187-
188- 就可以查看React Native的历史和最新版本
189-
190- - React Native可以直接更新到某个版本:
191-
192- > npm install --save [email protected] 193-
194- 就可以更新到0.23.0版本
195-
196- 如果升级后出现类似于
197- ```
198- [email protected] requires a peer of react@^0.14.5 but none was installed.199- ```
200-
201- 执行:
202- > npm install --save react
203-
204- 或者:
205- > npm install --save [email protected] 206-
207- 即可。
208-
209- 如果更新后执行react-native run-android不能正确运行,而是出现类似:
210- ```
211- Could not find com.facebook.react:react-native:0.23.0.
212- ```
213-
214- 错误,或者在Android Studio中直接运行app时报错:
215- ```
216- Android Studio failed to resolve com.facebook.react:react-native:0.23.0
217- ```
218-
219- 那么可以按照下列命令修复,首先在命令行中执行:
220- > npm i
221-
222- 执行完毕且不报错后,执行下面的命令,** 注意,在执行命令之后,某些文件可能会产生冲突,请确保你的本地文件记录可以恢复** (在Android Studio中可以查看历史记录来恢复文件)
223- > react-native upgrade
224-
225- 执行上面的命令可能会提示你是否覆盖文件。在解决冲突之后重新运行App即可。
You can’t perform that action at this time.
0 commit comments