You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: update @types/node to resolve Vite 7.x peer dependency conflict (#82794)
## Problem
The project was experiencing npm dependency resolution conflicts when
running `npm install`, caused by incompatible @types/node versions
between Vite 7.1.3 and the existing project dependencies.
Fixes: #82779
**Error Details:**
- Vite 7.1.3 requires `@types/node@"^20.19.0 || >=22.12.0"`
- Project was using `@types/[email protected]`
- This created a peer dependency conflict, preventing clean installs
## Solution
Updated `@types/node` from `20.10.4` to a compatible version that
satisfies Vite 7.x requirements while maintaining compatibility with
Vitest 3.2.4.
## Changes Made
- Updated `@types/node` version in package.json
- Verified compatibility with all existing dependencies
- Confirmed tests still pass with deprecation warnings (React.act import
warnings - separate issue)
## Testing
- [x] `npm install` runs without errors
- [x] `npm test` passes all existing tests
- [x] No breaking changes to existing functionality
## Additional Notes
This fix resolves the immediate dependency conflict. The React.act
deprecation warnings in tests are a separate issue and should be
addressed in a future PR by updating test imports from
`react-dom/test-utils` to `react`.
Details Issue:
1]
npm test
> test
> vitest
The CJS build of Vite's Node API is deprecated. See
https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated
for more details.
DEV v1.0.4
/home/hareesh/learn-frontend/front-open-source/next.js/examples/with-vitest
stderr | app/blog/[slug]/page.test.tsx > App Router: Works with dynamic
route segments
Warning: `ReactDOMTestUtils.act` is deprecated in favor of `React.act`.
Import `act` from `react` instead of `react-dom/test-utils`. See
https://react.dev/warnings/react-dom-test-utils for more info.
stderr | app/page.test.tsx > App Router: Works with Server Components
Warning: `ReactDOMTestUtils.act` is deprecated in favor of `React.act`.
Import `act` from `react` instead of `react-dom/test-utils`. See
https://react.dev/warnings/react-dom-test-utils for more info.
stderr | app/counter.test.tsx > App Router: Works with Client Components
Warning: `ReactDOMTestUtils.act` is deprecated in favor of `React.act`.
Import `act` from `react` instead of `react-dom/test-utils`. See
https://react.dev/warnings/react-dom-test-utils for more info.
stderr | __tests__/Home.test.tsx > Pages Router
Warning: `ReactDOMTestUtils.act` is deprecated in favor of `React.act`.
Import `act` from `react` instead of `react-dom/test-utils`. See
https://react.dev/warnings/react-dom-test-utils for more info.
2]
npm install
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: @types/[email protected]
npm error node_modules/@types/node
npm error dev @types/node@"20.10.4" from the root project
npm error peerOptional @types/node@"^18.0.0 || ^20.0.0 || >=22.0.0" from
[email protected]
npm error node_modules/vitest
npm error dev vitest@"^3.2.4" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional @types/node@"^20.19.0 || >=22.12.0" from
[email protected]
npm error node_modules/vite
npm error peer vite@"^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" from
@vitejs/[email protected]
npm error node_modules/@vitejs/plugin-react
npm error dev @vitejs/plugin-react@"^4.2.1" from the root project
npm error vite@"^5.0.0 || ^6.0.0 || ^7.0.0-0" from [email protected]
npm error node_modules/vitest
npm error dev vitest@"^3.2.4" from the root project
npm error
npm error Conflicting peer dependency: @types/[email protected]
npm error node_modules/@types/node
npm error peerOptional @types/node@"^20.19.0 || >=22.12.0" from
[email protected]
npm error node_modules/vite
npm error peer vite@"^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" from
@vitejs/[email protected]
npm error node_modules/@vitejs/plugin-react
npm error dev @vitejs/plugin-react@"^4.2.1" from the root project
npm error vite@"^5.0.0 || ^6.0.0 || ^7.0.0-0" from [email protected]
npm error node_modules/vitest
npm error dev vitest@"^3.2.4" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency
resolution.
npm error
npm error
npm error For a full report see:
npm error
/home/hareesh/.npm/_logs/2025-08-19T17_17_17_782Z-eresolve-report.txt
npm error A complete log of this run can be found in:
/home/hareesh/.npm/_logs/2025-08-19T17_17_17_782Z-debug-0.log
---------
Co-authored-by: Joseph <[email protected]>
Co-authored-by: Joseph <[email protected]>
0 commit comments