最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

next.js - Not able to install shadcn correctly - Stack Overflow

programmeradmin4浏览0评论
npx shadcn@latest init
✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS.
✔ Validating import alias.
✔ Which style would you like to use? › New York
✔ Which color would you like to use as the base color? › Zinc
✔ Would you like to use CSS variables for theming? … no / yes
✔ Writing components.json.
✔ Checking registry.
✔ Updating tailwind.config.ts
✔ Updating styles/globals.css
⠼ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: npm install tailwindcss-animate class-variance-authority lucide-react clsx tailwind-merge
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @typescript-eslint/[email protected]
npm WARN Found: [email protected]
npm WARN node_modules/eslint
npm WARN   peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/[email protected]
npm WARN   node_modules/@eslint-community/eslint-utils
npm WARN     @eslint-community/eslint-utils@"^4.2.0" from [email protected]
npm WARN   5 more (eslint-import-resolver-typescript, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^7.0.0 || ^8.0.0" from @typescript-eslint/[email protected]
npm WARN node_modules/@typescript-eslint/parser
npm WARN   @typescript-eslint/parser@"^5.4.2 || ^6.0.0" from [email protected]
npm WARN   node_modules/eslint-config-next
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/eslint
npm WARN   peer eslint@"^7.0.0 || ^8.0.0" from @typescript-eslint/[email protected]
npm WARN   node_modules/@typescript-eslint/parser
npm WARN     @typescript-eslint/parser@"^5.4.2 || ^6.0.0" from [email protected]
npm WARN     node_modules/eslint-config-next
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/[email protected]
npm ERR!   node_modules/@eslint-community/eslint-utils
npm ERR!     @eslint-community/eslint-utils@"^4.2.0" from [email protected]
npm ERR!   peer eslint@"*" from [email protected]
npm ERR!   node_modules/eslint-import-resolver-typescript
npm ERR!     eslint-import-resolver-typescript@"^3.5.2" from [email protected]
npm ERR!     node_modules/eslint-config-next
npm ERR!       dev eslint-config-next@"14.0.4" from the root project
npm ERR!   4 more (eslint-plugin-import, eslint-plugin-jsx-a11y, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^7.23.0 || ^8.0.0" from [email protected]
npm ERR! node_modules/eslint-config-next
npm ERR!   dev eslint-config-next@"14.0.4" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^7.23.0 || ^8.0.0" from [email protected]
npm ERR!   node_modules/eslint-config-next
npm ERR!     dev eslint-config-next@"14.0.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!
npm ERR! For a full report see:
npm ERR! /home/gyanedra-thakur/.npm/_logs/2025-02-16T06_46_33_051Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gyanedra-thakur/.npm/_logs/2025-02-16T06_46_33_051Z-debug-0.log

whenever I am trying to initialize my Next.js project with the shadcn it is showing this error. I guess this is mostly the error with the peer dependencies and React version. SO I have tried downgrading the React version and alternatively used the --legacy-peer-deps as a solution yet that doesn't help.

I have tried using --force and --legacy-peer-deps but nothing is working can someone help me with that.

发布评论

评论列表(0)

  1. 暂无评论