简体   繁体   English

无法解析依赖关系树,我无法再使用节点 package 管理器安装包

[英]Unable to resolve dependency tree, I no longer can install packages with node package manager

I'm developing a react native application.我正在开发一个本机反应应用程序。 Throughout the project I have used Node package manager to install the packages.在整个项目中,我使用 Node package 管理器来安装包。 But I ran into this dependency problem first time when I try to install react-native-styled-components with npm, so I installed it with yarn.但是我第一次尝试使用 npm 安装 react-native-styled-components 时遇到了这个依赖问题,所以我用 yarn 安装了它。 Now I can't install any package with node package manager, I run into this unable to resolve dependency tree error.现在我无法使用节点 package 管理器安装任何 package,我遇到了无法解决依赖树错误。

PS C:\Users\94774\OneDrive\React Projects\Native Projects\Android\socialmediaapp> npm install react@latest react-native@latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: socialmediaapp@0.0.1
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-native@0.64.1
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.64.1" 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! See C:\Users\94774\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\94774\AppData\Local\npm-cache\_logs\2021-05-06T12_12_44_173Z-debug.log
PS C:\Users\94774\OneDrive\React Projects\Native Projects\Android\socialmediaapp> npm install --save @react-native-firebase/app
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: socialmediaapp@0.0.1     
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!   peer react@">= 16.8.0" from styled-components@5.3.0    
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"^5.3.0" from the root project     
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-dom@17.0.2
npm ERR! node_modules/react-dom
npm ERR!   peer react-dom@">= 16.8.0" from styled-components@5.3.0
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"^5.3.0" 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! See C:\Users\94774\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\94774\AppData\Local\npm-cache\_logs\2021-05-06T12_41_01_675Z-debug.log

npm install react-native-styled-components --legacy-peer-deps npm 安装 react-native-styled-components --legacy-peer-deps

Use yarn add styled-components command but it will give another warning has unmet peer dependency "react-dom@>= 16.8.0" The error rises because the dependencies were unmet使用yarn add styled-components命令,但它会给出另一个警告has unmet peer dependency "react-dom@>= 16.8.0"由于未满足依赖关系,错误上升

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

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