React Native - console.error: 'React Native 版本不匹配 [英] React Native - console.error: 'React Native version mismatch
问题描述
我正在使用 EXPO 和 React Native,应用程序运行完全正常,直到我创建一个新文件时它突然停止,即使我删除它,错误仍然存在.
I am using EXPO and React Native, the app work running completely fine until it suddenly stopped when I made a new file and even when I deleted it, the error stayed.
我已将 React Native 更新到 V0.56.0 但它仍然显示错误:
I have updated React Native to V0.56.0 but it is still showing the error:
console.error: 'React Native 版本不匹配.
console.error: 'React Native version mismatch.
Javascript 版本:0.56.0原生版本:0.52.0
Javascript version: 0.56.0 Native Version: 0.52.0
在我更新之前:
Javascript 版本:0.54.0原生版本:0.52.0
Javascript version: 0.54.0 Native Version: 0.52.0
仍然导致同样的错误?
关于如何解决这个问题以及我使用哪个命令来更新本机版本的任何想法?
Any ideas on how I fix this and which command I use to update the Native Version?
推荐答案
转到项目文件夹中的 package.json
文件
Go to package.json
file inside your project folder
在哪里可以找到这样的代码
Where you can find code like this
"dependencies": {
.....
"react-native": "^0.54.0",
......
},
将 react-native
版本改为 0.54
并保存文件.
change the react-native
version to 0.54
and save file.
然后转到终端并重定向到您的项目文件夹并点击命令
Then go to the terminal and redirect to your project folder and hit the command
npm install && expo start -c
这篇关于React Native - console.error: 'React Native 版本不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!