Error compile

smsoousa3 months ago

Hello everybody! Any tips on what this package conflict could be? Version 6.5

npm install
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @mui/styles@5.16.7
npm error Found: react@18.3.1
npm error node_modules/react
npm error   react@"^18.3.1" from the root project
npm error   peer react@">=16.8.0" from @emotion/react@11.13.3
npm error   node_modules/@emotion/react
npm error     @emotion/react@"^11.13.3" from the root project
npm error     peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.13.0
npm error     node_modules/@emotion/styled
npm error       @emotion/styled@"^11.13.0" from the root project
npm error       5 more (@mui/lab, @mui/material, @mui/styled-engine, ...)
npm error     5 more (@mui/lab, @mui/material, @mui/styled-engine, ...)
npm error   26 more (@emotion/styled, ...)
npm error
npm error Could not resolve dependency:
npm error peer react@"^17.0.0" from @mui/styles@5.16.7
npm error node_modules/@mui/styles
npm error   @mui/styles@"^5.16.7" from the root project
npm error   peer @mui/styles@"^5.0.1" from react-mui-dropzone@4.0.7
npm error   node_modules/react-mui-dropzone
npm error     react-mui-dropzone@"^4.0.7" from the root project
npm error
npm error Conflicting peer dependency: react@17.0.2
npm error node_modules/react
npm error   peer react@"^17.0.0" from @mui/styles@5.16.7
npm error   node_modules/@mui/styles
npm error     @mui/styles@"^5.16.7" from the root project
npm error     peer @mui/styles@"^5.0.1" from react-mui-dropzone@4.0.7
npm error     node_modules/react-mui-dropzone
npm error       react-mui-dropzone@"^4.0.7" 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.
Anton Tananaev3 months ago

Works fine for me.

smsoousa3 months ago

react@18.3.1 used in the project is incompatible with the version of @mui/styles, which requires react@17.x.
My node version is: v22.6.0 and npm: v10.8.2.
I was only able to install the dependencies this way: npm install --legacy-peer-deps
Any additional recommendations?

Anton Tananaev3 months ago

It doesn't give me any errors and no errors on CI.

Cristian3 months ago

I just downloaded version 6.5 and was able to compile without problems.

But with version 6.3 something similar happened to me and it was solved here

https://www.traccar.org/forums/topic/could-not-resolve-dependency/

smsoousa3 months ago

I already tried deleting the project and recreating, but I still get the error. I'm going to try to use the original VS Code for Linux, as I'm using the OSS version, maybe that's the problem. I'll come back here to say if it worked. Thanks