a year ago
When I try to deploy my NodeJS + React application I get a dependency resolution error. I tried upgrading the version of the conflicting dependency, "react-alert@7.0.3", but it is already on its latest version; and it is not possible for me to downgrade the react version to a minor one because this would cause too many problems in my application.
Is there any other solution, where should I include the --force or --legacy-peer-deps flag to try the forced resolution of these dependencies? I tried to include these flags in my install command of my package.json and also in the Railway settings but it didn't work.
```#11 3.807 npm ERR! While resolving: react-alert@7.0.3
11 3.807 npm ERR! Found: react@18.2.0
11 3.807 npm ERR! node_modules/react
11 3.807 npm ERR! react@"^18.2.0" from the root project
11 3.807 npm ERR! peer react@">=16.13.1" from @cyntler/react-doc-viewer@1.14.1
11 3.807 npm ERR! node_modules/@cyntler/react-doc-viewer
11 3.807 npm ERR! 63 more (@dnd-kit/accessibility, @dnd-kit/core, …)
11 3.807 npm ERR!
11 3.807 npm ERR! Could not resolve dependency:
11 3.807 npm ERR! peer react@"^16.8.1 || ^17" from react-alert@7.0.3
11 3.807 npm ERR! node_modules/react-alert
11 3.807 npm ERR! react-alert@"^7.0.3" from the root project
11 3.807 npm ERR!
11 3.807 npm ERR! Conflicting peer dependency: react@17.0.2
11 3.807 npm ERR! node_modules/react
11 3.807 npm ERR! peer react@"^16.8.1 || ^17" from react-alert@7.0.3
11 3.807 npm ERR! node_modules/react-alert
11 3.807 npm ERR! react-alert@"^7.0.3" from the root project
11 3.807 npm ERR!
11 3.808 npm ERR! Fix the upstream dependency conflict, or retry
11 3.808 npm ERR! this command with --force, or --legacy-peer-deps
11 3.808 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
11 3.808 npm ERR!
11 3.808 npm ERR! See /root/.npm/eresolve-report.txt for a full report.
11 3.809
11 3.809 npm ERR! A complete log of this run can be found in:
11 3.809 npm ERR! /root/.npm/logs/2024-04-30T040802185Z-debug-0.log
11 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
[stage-0 7/11] RUN --mount=type=cache,id=s/3f11337c-5e0e-4e0e-9205-95e1ecd050e9-/root/npm,target=/root/.npm npm ci:
3.807 npm ERR! react-alert@"^7.0.3" from the root project
3.807 npm ERR!
3.808 npm ERR! Fix the upstream dependency conflict, or retry
3.808 npm ERR! this command with --force, or --legacy-peer-deps
3.808 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
3.808 npm ERR!
3.808 npm ERR! See /root/.npm/eresolve-report.txt for a full report.
3.809
3.809 npm ERR! A complete log of this run can be found in:
3.809 npm ERR! /root/.npm/logs/2024-04-30T040802185Z-debug-0.log
-----```
2 Replies
a year ago
Hi Brody,
Sorry for not answering you sooner, I hadn't seen the comments. I removed react-alert
from my project and replaced it with react-toastify
, with a version compatible with my version of react
, but I get new dependency resolution errors, which is strange because the application in a local environment works correctly and also on a server had already worked without any problems.
I attach the full build logs.
Attachments