Report this

What is the reason for this report?

React App Build error in peer depency

Posted on June 22, 2022

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?



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!

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.

same problem… how to modify “npm ci” command to npm ci --legacy-peer-deps ?

Hello, I have the same problem. I tried to deploy a react app but I got an error about conflicting peer dependency. I make the package.json file like that: `

"scripts": {
    "start": "react-scripts start",
    "build": "npm install --legacy-peer-deps & react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },`

It does not work. Then, I tried to change the build command on the app’s setting.

Build Command npm install --legacy-peer-deps & npm run build

But it also does not work.

How can I achieve to run npm install --legacy-peer-deps?

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.