Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: npm i fails for new React/TypeScript/ESLint/Prettier project #3427

Closed
sam3k opened this issue Sep 9, 2024 · 1 comment · Fixed by #3441
Closed

[Bug]: npm i fails for new React/TypeScript/ESLint/Prettier project #3427

sam3k opened this issue Sep 9, 2024 · 1 comment · Fixed by #3441
Labels
🐞 bug Something isn't working

Comments

@sam3k
Copy link

sam3k commented Sep 9, 2024

Version

System:
    OS: macOS 14.2.1
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Memory: 702.71 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Brave Browser: 104.1.42.88
    Chrome: 128.0.6613.120
    Safari: 17.2.1
  npmPackages:
    N/A due to this bug
  Node version: v20.11.1
  NPM version: 10.2.4

Details

There seems to be a problem with npm i when you try to create a React/TypeScript/ESLint/Prettier project. However, if I do the install without checking "ESLint" and "Prettier", I am able to NPM install successfully.

Reproduce link

N/A

Reproduce Steps

❯ npm create rsbuild@latest

◆  Create Rsbuild Project
│
◇  Project name or path
│  portal
│
◇  Select framework
│  React
│
◇  Select language
│  TypeScript
│
◇  Select additional tools (Use <space> to select, <enter> to continue)
│  Add ESLint for code linting, Add Prettier for code formatting
│
◇  Next steps ──╮
│               │
│  cd portal    │
│  npm i        │
│  npm run dev  │
│               │
├───────────────╯
│
└  Done.

Then I do the "Next steps" mentioned above and get:

❯ npm i
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/eslint
npm ERR!   dev eslint@"^9.9.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" from [email protected]
npm ERR! node_modules/eslint-plugin-react-hooks
npm ERR!   dev eslint-plugin-react-hooks@"^4.6.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! 
npm ERR! For a full report see:
npm ERR! /Users/me/.npm/_logs/2024-09-09T20_04_39_034Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/me/.npm/_logs/2024-09-09T20_04_39_034Z-debug-0.log
@9aoy
Copy link
Collaborator

9aoy commented Sep 10, 2024

Wait for eslint-plugin-react-hooks to release 5.0 stable, or you can use pnpm instead.
web-infra-dev/rspack#7802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants