当我尝试在 nextjs 14.1.0 中安装 next-contentlayer 时。它显示错误。我无法安装 next-contentlayer。 谁能建议我如何安装它?
`npm install next-contentlayer
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/next
npm ERR! next@"14.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^12 || ^13" from [email protected]
npm ERR! node_modules/next-contentlayer
npm ERR! next-contentlayer@"*" 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.
基本上,下一个内容层存在依赖冲突,因为它需要下一个 12 或 13,并且维护者尚未更新下一个 14
你可以尝试2件事
npm install [email protected]
npm install next-contentlayer
npm install next-contentlayer --force