shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.72k stars 1.27k forks source link

Could not resolve dependency when running GitLab CI #135

Closed YikSanChan closed 3 years ago

YikSanChan commented 3 years ago

Hi,

This is the failed CI pipeline https://gitlab.com/YikSanChan/docs/-/jobs/1192193217, that complains:

$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"^16.6.0 || ^17" from next@10.1.3
npm ERR!   node_modules/next
npm ERR!     next@"^10.0.7" from the root project
npm ERR!     peer next@">=9.5.3" from nextra-theme-docs@1.1.6
npm ERR!     node_modules/nextra-theme-docs
npm ERR!       nextra-theme-docs@"^1.1.4" from the root project
npm ERR!   9 more (react-dom, nextra, nextra-theme-docs, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @reach/skip-nav@0.11.2
npm ERR! node_modules/nextra-theme-docs/node_modules/@reach/skip-nav
npm ERR!   @reach/skip-nav@"^0.11.2" from nextra-theme-docs@1.1.6
npm ERR!   node_modules/nextra-theme-docs
npm ERR!     nextra-theme-docs@"^1.1.4" 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 /root/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-04-19T13_52_47_004Z-debug.log
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1

I am following https://nextra.vercel.app/docs/get-started and using the same versions as in https://github.com/vercel/swr-site/blob/master/package.json. All my code (they are minimal) can be found here. Any help?

Thanks!

leerob commented 3 years ago

You can either use --legacy-peer-deps or update to the latest version of nextra 🙏

YikSanChan commented 3 years ago

@leerob Update tot latest version of nextra doesn't resolve the issue, but I proceed with --legacy-peer-deps. Thanks!

YikSanChan commented 3 years ago

@leerob Hi Lee, I have a follow-up as described in https://github.com/shuding/nextra/issues/136. Can you please help take a look? Thanks!