Reputation: 21
Error during npm install
for Next.js project: ERESOLVE could not resolve dependencies
npm WARN ERESOLVE overriding peer dependencynpm WARN While resolving: @atlaskit/[email protected] WARN Found: [email protected] WARN node_modules/reactnpm WARN react@"^19.0.0" from the root projectnpm WARN 93 more (@emotion/react, ...)npm WARNnpm WARN Could not resolve dependency:npm WARN peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @atlaskit/[email protected] WARN node_modules/@atlaskit/ds-libnpm WARN @atlaskit/ds-lib@"^3.2.0" from @atlaskit/[email protected] WARN node_modules/@atlaskit/motionnpm WARN 1 more (@atlaskit/tokens)npm WARNnpm WARN Conflicting peer dependency: [email protected] WARN node_modules/reactnpm WARN peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @atlaskit/[email protected] WARN node_modules/@atlaskit/ds-libnpm WARN @atlaskit/ds-lib@"^3.2.0" from @atlaskit/[email protected] WARN node_modules/@atlaskit/motionnpm WARN 1 more (@atlaskit/tokens)npm WARN ERESOLVE overriding peer dependencynpm WARN While resolving: @atlaskit/[email protected] WARN Found: [email protected] WARN node_modules/reactnpm WARN react@"^19.0.0" from the root projectnpm WARN 93 more (@emotion/react, ...)npm WARNnpm WARN Could not resolve dependency:npm WARN peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @atlaskit/[email protected] WARN node_modules/@atlaskit/motionnpm WARN @atlaskit/motion@"^1.9.0" from @atlaskit/[email protected] WARN node_modules/@atlaskit/pragmatic-drag-and-drop-flourishnpm WARNnpm WARN Conflicting peer dependency: [email protected] WARN node_modules/reactnpm WARN peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @atlaskit/[email protected] WARN node_modules/@atlaskit/motionnpm WARN @atlaskit/motion@"^1.9.0" from @atlaskit/[email protected] WARN node_modules/@atlaskit/pragmatic-drag-and-drop-flourishnpm ERR! code ERESOLVEnpm ERR! ERESOLVE could not resolvenpm ERR!npm ERR! While resolving: @atlaskit/[email protected] ERR! Found: [email protected] ERR! node_modules/reactnpm ERR! react@"^19.0.0" from the root projectnpm ERR! peer react@">=16.8.0" from @emotion/[email protected] ERR! node_modules/@emotion/reactnpm ERR! @emotion/react@"^11.7.1" from @atlaskit/[email protected] ERR! node_modules/@atlaskit/motionnpm ERR! @atlaskit/motion@"^1.9.0" from @atlaskit/[email protected] ERR! node_modules/@atlaskit/pragmatic-drag-and-drop-flourishnpm ERR! @atlaskit/pragmatic-drag-and-drop-flourish@"^1.1.2" from the root projectnpm ERR! 92 more (@emotion/use-insertion-effect-with-fallbacks, ...)npm ERR!npm ERR! Could not resolve dependency:npm ERR! peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @atlaskit/[email protected] ERR! node_modules/@atlaskit/pragmatic-drag-and-drop-flourishnpm ERR! @atlaskit/pragmatic-drag-and-drop-flourish@"^1.1.2" from the root projectnpm ERR!npm ERR! Conflicting peer dependency: [email protected] ERR! node_modules/reactnpm ERR! peer react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @atlaskit/[email protected] ERR! node_modules/@atlaskit/pragmatic-drag-and-drop-flourishnpm ERR! @atlaskit/pragmatic-drag-and-drop-flourish@"^1.1.2" from the root projectnpm ERR!npm ERR! Fix the upstream dependency conflict, or retrynpm ERR! this command with --force or --legacy-peer-depsnpm ERR! to accept an incorrect (and potentially broken) dependency resolution.npm ERR!npm ERR!
npm install
Node.js version: v20.13.1
npm version: 10.5.2
Operating System: Windows 11
What is the recommended way to resolve this dependency conflict?
Is it safe to use --force
or --legacy-peer-deps
, and what are the potential risks?
Should I downgrade React to a compatible version to resolve these warnings, and if so, how would that impact the project?
Any guidance or best practices for handling these dependency conflicts in Next.js projects would be greatly appreciated.
Upvotes: 2
Views: 63
Reputation: 21
Should be a network or firewall issue blocking NPM commands. Try switching to another network, should work perfectly.
Upvotes: 1
Reputation: 11
In my opinion i am not recommended to use --force or --legacy-peer-deps.it may affect other packages results in import error in all pages.u can downgrade your react->^18 version and try install that library.
or u can u simliy install via cdn check below reference: https://www.jsdelivr.com/package/npm/@atlaskit/ds-lib
or try to find similar package in npm: https://www.npmjs.com/search?q=%40atlaskit%2Fds-lib
Upvotes: 1