react,eas 构建错误:“在中运行“npm install””,“无法解析依赖项”

问题描述 投票:0回答:1

我有一个 React expo 项目,当我使用 expoGo 应用程序时,该项目运行良好, 但是当我尝试使用 eas-cli 构建我的项目时, 我遇到了一些无法解决的错误。 这是我的日志:

Running "npm install" in /home/expo/workingdir/build directory
npm ERR!
code ERESOLVE
npm
ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native-gesture-handler
npm ERR!   react-native-gesture-handler@"^2.12.1" from the root project
npm ERR!   peer react-native-gesture-handler@">= 1.0.0" from @react-navigation/[email protected]
npm
ERR!   node_modules/@react-navigation/drawer
npm ERR!     @react-navigation/drawer@"^6.6.6" from the root project
npm ERR!     peerOptional @react-navigation/drawer@"^6.5.8" from [email protected]
npm ERR!     node_modules/expo-router
npm ERR!       expo-router@"^2.0.0" from the root project
npm ERR!   2 more (@react-navigation/stack, expo-router)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-gesture-handler@"^1.0.12" from [email protected]
npm ERR! node_modules/react-navigation-drawer
npm ERR!
react-navigation-drawer@"^2.7.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react-native-gesture-handler
npm ERR!   peer react-native-gesture-handler@"^1.0.12" from [email protected]
npm ERR!   node_modules/react-navigation-drawer
npm ERR!     react-navigation-drawer@"^2.7.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /home/expo/.npm/_logs/2024-04-25T13_12_23_758Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/expo/.npm/_logs/2024-04-25T13_12_23_758Z-debug-0.log

有人遇到这个问题吗?

reactjs expo eas
1个回答
0
投票

只需运行命令

npm install --force

© www.soinside.com 2019 - 2024. All rights reserved.