首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >到达“安装依赖项”时EAS生成错误

到达“安装依赖项”时EAS生成错误
EN

Stack Overflow用户
提问于 2022-11-26 20:51:26
回答 2查看 180关注 0票数 2

不久前,我已经开始使用react本地的世博会,所以我有点迷失了。

当尝试使用以下命令构建应用程序时:

代码语言:javascript
运行
复制
eas build --profile development --platform android

当到达安装依赖项部分时,生成失败。

代码语言:javascript
运行
复制
Running "npm install" in the root dir of your repository 2[stderr] npm ERR! code ERESOLVE3[stderr] npm ERR!4[stderr] ERESOLVE could not resolve5[stderr] npm ERR! 6[stderr] npm ERR!7[stderr] While resolving: @react-native-firebase/auth@16.2.08[stderr] npm ERR! Found: @react-native-firebase/app@15.4.09[stderr] npm ERR! node_modules/@react-native-firebase/app10[stderr] npm ERR!   @react-native-firebase/app@"~15.4.0" from the root project11[stderr] npm ERR! 12[stderr] npm ERR! Could not resolve dependency:13[stderr] npm ERR! peer @react-native-firebase/app@"16.2.0" from @react-native-firebase/auth@16.2.014[stderr] npm ERR! node_modules/@react-native-firebase/auth15[stderr] npm ERR!   @react-native-firebase/auth@"^16.2.0" from the root project16[stderr] npm17[stderr] ERR! 18[stderr] npm ERR! Conflicting peer dependency: @react-native-firebase/app@16.2.019[stderr] npm ERR! node_modules/@react-native-firebase/app20[stderr] npm ERR!   peer @react-native-firebase/app@"16.2.0" from @react-native-firebase/auth@16.2.021[stderr] npm ERR!   node_modules/@react-native-firebase/auth22[stderr] npm ERR!     @react-native-firebase/auth@"^16.2.0" from the root project23[stderr] npm ERR! 24[stderr] npm ERR! Fix the upstream dependency conflict, or retry25[stderr] npm ERR! this command with --force, or --legacy-peer-deps26[stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.27[stderr] npm ERR! 28[stderr] npm ERR! See /home/expo/.npm/eresolve-report.txt for a full report.29[stderr] 30[stderr] npm ERR! A complete log of this run can be found in:31[stderr] npm ERR!     /home/expo/.npm/_logs/2022-11-26T18_50_07_398Z-debug-0.log32npm exited with non-zero code: 1

我已经尝试过清除缓存和重建应用程序。当我尝试npx expo start --dev-client时,这个应用程序运行得很好。

这是我的package.json

代码语言:javascript
运行
复制
{
    "name": "wallet",
    "version": "1.0.0",
    "main": "node_modules/expo/AppEntry.js",
    "scripts": {
        "start": "expo start",
        "android": "expo start --android",
        "ios": "expo start --ios",
        "web": "expo start --web"
    },
    "dependencies": {
        "@react-native-firebase/app": "~15.4.0",
        "@react-native-firebase/auth": "^16.2.0",
        "@react-native-google-signin/google-signin": "^8.0.1",
        "@react-navigation/bottom-tabs": "^6.4.0",
        "@react-navigation/drawer": "^6.5.0",
        "@react-navigation/material-top-tabs": "^6.3.0",
        "@react-navigation/native": "^6.0.13",
        "@react-navigation/native-stack": "^6.9.1",
        "@rneui/base": "^4.0.0-rc.7",
        "@rneui/themed": "^4.0.0-rc.7",
        "expo": "~46.0.16",
        "expo-dev-client": "~1.3.1",
        "expo-font": "~10.2.0",
        "expo-linear-gradient": "~11.4.0",
        "expo-local-authentication": "~12.3.0",
        "expo-status-bar": "~1.4.0",
        "formik": "^2.2.9",
        "moment": "^2.29.4",
        "react": "18.0.0",
        "react-native": "0.69.6",
        "react-native-gesture-handler": "~2.5.0",
        "react-native-icon-badge": "^1.1.3",
        "react-native-linear-gradient": "^2.6.2",
        "react-native-pager-view": "^5.4.24",
        "react-native-reanimated": "~2.9.1",
        "react-native-recaptcha-that-works": "^1.3.2",
        "react-native-safe-area-context": "^4.3.1",
        "react-native-screens": "~3.15.0",
        "react-native-tab-view": "^3.3.0",
        "react-native-webview": "11.23.0",
        "styled-components": "^5.3.6"
    },
    "devDependencies": {
        "@babel/core": "^7.12.9"
    },
    "private": true
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-11-28 16:48:11

在深入研究特定的缺失或冲突的依赖关系之后,我设法通过以下方法解决了这个问题:

使用rm -rf node_modules.

  • update
  1. 删除node_modules (从终端)到版本18.1.0
  2. react dom 18.1.0之后,我成功地用EAS构建了这个应用程序,但是在我启动它之后,它立即崩溃了,在我的设备上没有任何错误。

通过将设备连接到我的PC来调试设备错误后,我发现我的一些expo依赖项没有被更新,所以我使用了以下命令:expo doctor --fix dependencies.

在那之后,这个应用程序终于实现了。正确发射

“谢谢你,”考斯克说,“谢谢你带我找到这个办法。

上面的一些事情可能没有联系,但这就是我所做的。

票数 0
EN

Stack Overflow用户

发布于 2022-11-27 13:09:21

今天我在为生产而建的时候遇到了同样的问题。我通过以下方式解决了安装依赖关系:

yarn install

之后,eas切换到纱线,而不是使用npm来安装包装。希望它对你有用。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74585507

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档