Question

React App Build error in peer depency

As I am trying to set up a react app thought the apps manager, the build logs inform me about a peer dependency from some of the libraries.

npm ERR! code ERESOLVE
[2022-06-22 21:24:23] npm ERR! ERESOLVE could not resolve
[2022-06-22 21:24:23] npm ERR! 
[2022-06-22 21:24:23] npm ERR! While resolving: react-vis@1.11.7
[2022-06-22 21:24:23] npm ERR! Found: react@17.0.2
[2022-06-22 21:24:23] npm ERR! node_modules/react
[2022-06-22 21:24:23] npm ERR!   react@"^17.0.2" from the root project
[2022-06-22 21:24:23] npm ERR!   peer react@"^16.8 || 17 || 18" from @blueprintjs/core@4.5.0
[2022-06-22 21:24:23] npm ERR!   node_modules/@blueprintjs/core
[2022-06-22 21:24:23] npm ERR!     @blueprintjs/core@"^4.3.2" from the root project
[2022-06-22 21:24:23] npm ERR!     @blueprintjs/core@"^4.5.0" from @blueprintjs/datetime@4.3.0
[2022-06-22 21:24:23] npm ERR!     node_modules/@blueprintjs/datetime
[2022-06-22 21:24:23] npm ERR!       @blueprintjs/datetime@"^4.3.0" from the root project
[2022-06-22 21:24:23] npm ERR!     2 more (@blueprintjs/popover2, @blueprintjs/select)
[2022-06-22 21:24:23] npm ERR!   21 more (@blueprintjs/datetime, @blueprintjs/popover2, ...)
[2022-06-22 21:24:23] npm ERR! 
[2022-06-22 21:24:23] npm ERR! Could not resolve dependency:
[2022-06-22 21:24:23] npm ERR! peer react@"15.3.0 - 16.x" from react-vis@1.11.7
[2022-06-22 21:24:23] npm ERR! node_modules/react-vis
[2022-06-22 21:24:23] npm ERR!   react-vis@"^1.11.7" from the root project
[2022-06-22 21:24:23] npm ERR! 
[2022-06-22 21:24:23] npm ERR! Conflicting peer dependency: react@16.14.0
[2022-06-22 21:24:23] npm ERR! node_modules/react
[2022-06-22 21:24:23] npm ERR!   peer react@"15.3.0 - 16.x" from react-vis@1.11.7
[2022-06-22 21:24:23] npm ERR!   node_modules/react-vis
[2022-06-22 21:24:23] npm ERR!     react-vis@"^1.11.7" from the root project
[2022-06-22 21:24:23] npm ERR! 
[2022-06-22 21:24:23] npm ERR! Fix the upstream dependency conflict, or retry
[2022-06-22 21:24:23] npm ERR! this command with --force, or --legacy-peer-deps
[2022-06-22 21:24:23] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I solve this problem locally by using npm i -f, but trying to deploy the app, the systems uses npm ci and I have zero knowledge on how to change that.

Any way to tell the system which command to run when booting the app?


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Add a .npmrc file with this line in it:

legacy-peer-deps=true

Just ran into this. Setting the environment variable npm_config_force to true should work the same way as force param and will fix the issue.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

did any body fix the problem