简体   繁体   English

你的项目是SDK版本 >= 33.0.0,但是expo包版本好像比较旧

[英]Your project is in SDK version >= 33.0.0, but the expo package version seems to be older

I can't start my Expo app.我无法启动我的 Expo 应用程序。 I am getting this error:我收到此错误:

Your project is in SDK version >= 33.0.0, but the expo package version seems to be older.
(0 , _config(...).fileExistsAsync) is not a function

It was working properly on Monday.它在星期一工作正常。 My expo cli and sdk versions are 36.0.0, so the newest ones.我的 expo cli 和 sdk 版本是 36.0.0,所以是最新的。 Did anyone have this problem as well and knows a possible fix for this?有没有人也有这个问题并且知道可能的解决方法?

I am using an Android Studio Emulator.我正在使用 Android Studio 模拟器。

Just ran expo upgrade and it told me that I am already using the newest versions but I ran it anyways and it ended with this:刚刚运行了 expo upgrade,它告诉我我已经在使用最新版本,但我还是运行了它,结果是这样的:

ConfigUtils(...).resolveModule is not a function

There are two possibilities: your global installation of the expo-cli package is outdated, or your expo package in the project itself is outdated.有两种可能性:您的 expo-cli 包的全局安装已过时,或者您在项目本身中的 expo 包已过时。

To figure this out, run npm ls in your project directory and search for the expo version.要解决这个问题,请在项目目录中运行npm ls并搜索 expo 版本。 If you're on a unix based system or have grep otherwise installed you can do this quickly with npm ls | grep expo如果您使用的是基于 unix 的系统或以其他方式安装了 grep,则可以使用npm ls | grep expo快速完成此操作。 npm ls | grep expo . npm ls | grep expo

If either of these show an expo package version less than 33.0.0 then you need to update the project's expo with expo update 35.0.0.如果其中任何一个显示 expo 包版本低于 33.0.0,那么您需要使用expo update 35.0.0.

On the other hand, if the expo version in the project is above 33.0.0 then the global version needs an update, which can be fixed with npm install -g expo-cli另一方面,如果项目中的 expo 版本高于 33.0.0,则全局版本需要更新,可以使用npm install -g expo-cli修复

https://docs.expo.io/versions/latest/workflow/upgrading-expo-sdk-walkthrough/ https://docs.expo.io/versions/latest/workflow/upgrading-expo-sdk-walkthrough/

The problem lies with both SDK and the Expo client version mis-match.问题在于SDKExpo 客户端版本不匹配。 Try doing this in the terminal with sudo and give the password:尝试在终端中使用sudo执行此操作并输入密码:

sudo expo update <version>
sudo expo start

Do change <version with the latest or minimum version the error occured at.请将<version更改为发生错误的最新版本或最低版本。 mine was 37.0.0我的是 37.0.0

Happy to Help.by RTTSS .乐于助人。RTTSS 提供

run this:运行这个:

npm install -g expo-cli

Alright I fixed it by myself.好吧,我自己修好了。 Even though I had the newest cli I had to upgrade it again and then I had to change the blacklist.js file located in node-modules/metro-config/src/defaults/blacklist.js to this:即使我有最新的 cli,我也不得不再次升级它,然后我不得不将位于 node-modules/metro-config/src/defaults/blacklist.js 中的 blacklist.js 文件更改为:

    var sharedBlacklist = [
  /node_modules[\/\\]react[\/\\]dist[\/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\/.*/
];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM