gpt4 book ai didi

node.js - 冲突的对等依赖项 : React Native for iOS

转载 作者:行者123 更新时间:2023-12-05 05:39:13 28 4
gpt4 key购买 nike

当我尝试在 Mac 上按照官方网站指南构建 React Native 程序时,出现以下错误。关于调试有什么建议吗?

npx react-native init A2 Need to install the following packages:
react-native@0.69.0 Ok to proceed? (y) y npm ERR! code ERESOLVE npmERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving:undefined@undefined npm ERR! Found: react-native@0.68.2 npm ERR!node_modules/react-native npm ERR! peer react-native@"*" from@react-native-community/cli@7.0.3 npm ERR!
node_modules/@react-native-community/cli npm ERR!
@react-native-community/cli@"^7.0.3" from react-native@0.68.2 npm ERR!react-native@"0.69.0" from the root project npm ERR! npm ERR! Couldnot resolve dependency: npm ERR! react-native@"0.69.0" from the rootproject npm ERR! npm ERR! Conflicting peer dependency: react@18.0.0npm ERR! node_modules/react npm ERR! peer react@"18.0.0" fromreact-native@0.69.0 npm ERR! node_modules/react-native npm ERR!
react-native@"0.69.0" from the root project npm ERR! npm ERR! Fix theupstream 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! See/Users/student/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR!
/Users/student/.npm/_logs/2022-06-25T16_09_36_906Z-debug-0.log

最佳答案

这是 Node 依赖最新版本的问题。此命令应该可以解决问题:npm config set legacy-peer-deps true。看看这个问题以供引用:https://github.com/facebook/react-native/issues/34051#issuecomment-1198463785

关于node.js - 冲突的对等依赖项 : React Native for iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72755617/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com