无法安装和卸载NPM程序包



以下是我尝试安装/卸载软件包后得到的结果:

(base) vivekrk@Viveks-MacBook-Air PUPA % npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: react-navigation-drawer@1.4.0
npm ERR! Found: react-native-screens@3.18.0
npm ERR! node_modules/react-native-screens
npm ERR!   react-native-screens@"^3.18.0" from the root project
npm ERR!   peer react-native-screens@">= 3.0.0" from @react-navigation/native-stack@6.9.0
npm ERR!   node_modules/@react-navigation/native-stack
npm ERR!     @react-navigation/native-stack@"^6.9.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-screens@"^1.0.0 || ^1.0.0-alpha" from react-navigation-drawer@1.4.0
npm ERR! node_modules/react-navigation-drawer
npm ERR!   react-navigation-drawer@"^1.4.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react-native-screens@1.0.0-alpha.23
npm ERR! node_modules/react-native-screens
npm ERR!   peer react-native-screens@"^1.0.0 || ^1.0.0-alpha" from react-navigation-drawer@1.4.0
npm ERR!   node_modules/react-navigation-drawer
npm ERR!     react-navigation-drawer@"^1.4.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 /Users/vivekrk/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/vivekrk/.npm/_logs/2022-10-10T04_17_37_997Z-debug-0.log

此外,我无法运行npx react-native start

这是在我安装了几个npm软件包之后发生的,这些软件包没有用,所以我卸载了。但在那之后,我无法安装新的软件包。

请解决我的问题!!

也许您有依赖冲突,所以您可以尝试使用--force运行它

完整命令:
npm install --force

或者您可以尝试降级您的nodejs版本。

最新更新