如何为我的 Next.js 项目解决以下依赖项?

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

我一直在尝试将我的 Next.js 应用程序部署到 Vercel,但在运行 npm install 时似乎出现以下错误:

labber@Viacaelestis:~/route-roamer$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR!   peer react@"^18.2.0" from [email protected]
npm ERR!   node_modules/next
npm ERR!     next@"^13.1.1" from the root project
npm ERR!     peer next@">=2" from [email protected]
npm ERR!     node_modules/next-routes
npm ERR!       next-routes@"^1.4.2" from the root project
npm ERR!   1 more (react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.4.2 || ^16" from [email protected]
npm ERR! node_modules/next-routes
npm ERR!   next-routes@"^1.4.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! See /home/labber/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/labber/.npm/_logs/2023-04-30T02_47_32_135Z-debug-0.log

对于上下文,在开发过程中,我们能够通过对所有 npm 安装使用 --force 来使应用程序简单地工作(我们知道这并不理想,但为了时间的缘故,我们还是这样做了——这是为了一个训练营的最终项目)。

我已经尝试了一些事情,例如尝试不同版本的 react-dates,但总的来说,我不确定我在做什么或者最好的方法是什么。对此的任何帮助将不胜感激!谢谢。

如果它有帮助,这里是我的这个项目的 Github 仓库的链接:https://github.com/michaelocenar/route-roamer

next.js dependencies
© www.soinside.com 2019 - 2024. All rights reserved.