startup-nextjs icon indicating copy to clipboard operation
startup-nextjs copied to clipboard

npm install not working

Open joshua-classen opened this issue 10 months ago • 2 comments

I get an Error when i want to install the packages with npm install:

npm install
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error   react@"19.0.0" from the root project
npm error   peer react@"^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0" from [email protected]
npm error   node_modules/next
npm error     next@"15.1.6" from the root project
npm error     peer next@"*" from [email protected]
npm error     node_modules/next-themes
npm error       next-themes@"^0.2.1" from the root project
npm error   4 more (next-themes, react-dom, react-transition-group, styled-jsx)
npm error
npm error Could not resolve dependency:
npm error peer react@"^17.0.0 || ^18.2.0" from [email protected]
npm error node_modules/react-modal-video
npm error   react-modal-video@"^2.0.1" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/react
npm error   peer react@"^17.0.0 || ^18.2.0" from [email protected]
npm error   node_modules/react-modal-video
npm error     react-modal-video@"^2.0.1" 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 /Users/joshuaclassen/.npm/_logs/2025-01-31T12_42_36_606Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/joshuaclassen/.npm/_logs/2025-01-31T12_42_36_606Z-debug-0.log

joshua-classen avatar Jan 31 '25 12:01 joshua-classen

Many common packages do not yet support the latest version of React, which this iteration of Next.js requires. This discrepancy creates a compatibility issue, as these packages are essential for Next.js 15 to function properly.

npm install --legacy-peer-deps command serves as a workaround for this issue.

https://nextjstemplates.com/blog/nextjs-15-npm-install-legacy-peer-deps

Musharofchy avatar Jan 31 '25 13:01 Musharofchy

@joshua-classen use yarn install

raulcarlomagno avatar Mar 26 '25 20:03 raulcarlomagno

Closing this issue as it was addressed in v2.2.0 - b8c08b5

johurul-pimjo avatar Aug 06 '25 05:08 johurul-pimjo