pradel / create-react-app-swc

Use swc in your create-react-app for faster compilation, development and tests
MIT License
129 stars 11 forks source link

Incompatible dependency versions #21

Closed ianldgs closed 2 years ago

ianldgs commented 2 years ago

Hi!

The version of craco that this library requires is 6, and react-scripts 5. However, craco 6 doesn't support react-scripts 5. Only craco 7, which is in alpha, supports react scripts 5. That's why I asked you to put "@craco/craco": "^6 || ^7" here: https://github.com/pradel/create-react-app-swc/pull/13/files/b33d44c555614a5e5a337c681cbbd95ce96ca18f#r837358369

Now with npm 8.6.0, I get the following error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: craco-swc@0.5.0
npm ERR! Found: @craco/craco@7.0.0-alpha.3
npm ERR! node_modules/@craco/craco
npm ERR!   dev @craco/craco@"^7.0.0-alpha.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @craco/craco@"^6.0.0" from craco-swc@0.5.0
npm ERR! node_modules/craco-swc
npm ERR!   dev craco-swc@"^0.5.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @craco/craco@6.4.3
npm ERR! node_modules/@craco/craco
npm ERR!   peer @craco/craco@"^6.0.0" from craco-swc@0.5.0
npm ERR!   node_modules/craco-swc
npm ERR!     dev craco-swc@"^0.5.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

People trying to do npm i -D @craco/craco craco-swc are likely having the same problems.

n0r8 commented 2 years ago

Oh yes, I am getting this one as well :D

pradel commented 2 years ago

Fixed 👍

ianldgs commented 2 years ago

Thanks for looking into it! But FYI: it apparently still doesn't work :/ I'll downgrade to npm 8.5 for now. It seems like in 8.6 they either have a breaking change, which then should be a major version bump, or a bug. Or maybe 7.0.0-alpha version isn't considered 7 yet.

pradel commented 2 years ago

Or maybe 7.0.0-alpha version isn't considered 7 yet.

Yeah I think this is the issue