question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

craco-less 2.0.0 requires react-scripts 5 but that's incompatible with craco 6.4.3

See original GitHub issue

I can’t seem to find versions of react-scripts and craco that are compatible with both craco-less 2.0.0 and each other.

craco 6.4.3 requires react-scripts 4 but then I get this error saying craco-less needs react-scripts 5:

npm ERR! Found: react-scripts@4.0.3
npm ERR! node_modules/react-scripts
npm ERR!   react-scripts@"4.0.3" from the root project
npm ERR!   peer react-scripts@"^4.0.0" from @craco/craco@6.4.0
npm ERR!   node_modules/@craco/craco
npm ERR!     @craco/craco@"6.4.0" from the root project
npm ERR!     peer @craco/craco@"^6.0.0" from craco-less@2.0.0
npm ERR!     node_modules/craco-less
npm ERR!       craco-less@"2.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-scripts@"^5.0.0" from craco-less@2.0.0
npm ERR! node_modules/craco-less
npm ERR!   craco-less@"2.0.0" from the root project

If instead I install the craco 7 alpha and react-scripts 5, craco-less doesn’t like the craco version:

npm ERR! Found: @craco/craco@7.0.0-alpha.0
npm ERR! node_modules/@craco/craco
npm ERR!   @craco/craco@"^7.0.0-alpha.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @craco/craco@"^6.0.0" from craco-less@2.0.0
npm ERR! node_modules/craco-less
npm ERR!   craco-less@"2.0.0" from the root project

What’s the right answer here?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:39
  • Comments:7

github_iconTop GitHub Comments

11reactions
edwardzjlcommented, Mar 16, 2022

I switched back to craco-less 1.20.0 with craco 6.4.3 and react-scripts 4.0.3 which works

3reactions
tux-tncommented, Apr 23, 2022

I’m really sorry guys for the delays. For people wanting to use craco-less with CRA 5 and Craco v7 a new pre-release have been published on NPM. And for some back-story. The changes introduced in craco-less 2.0.0 are meant to make it work with CRA5, hence the major version bump. At the time of the update (just before Christmas) Craco v7 alpha was not published yet and the peer-dependency issues are only relative to npm (I guess it’s related to the fact that yarn and npm are managing dependencies in different ways). As a temporary fix (until craco v7 is released) I suggest we add an entry to the readme with compatibility table between craco-less and cra/craco and recommend to people using npm to install the new alpha version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Craco does not work properly with react-scripts@5.0.0
craco 's Github readme, states that it is supporting Create React App (CRA) 4.
Read more >
You need to update your react-script package. As craco@6.4 ...
I have looked the error online and I am not yet what I am doing wrong. I would appreciate so much your help....
Read more >
craco-less - npm
A Less plugin for craco / react-scripts / create-react-app. Latest version: 2.0.0, last published: a year ago. Start using craco-less in ...
Read more >
Craco-antd NPM - npm.io
This is a craco plugin that makes it easy to use the Ant Design UI library with ... react-scripts : ^5.0.0; @craco/craco :...
Read more >
could not resolve dependency: npm err! peer react@&quot
“could not resolve dependency: npm err! peer react@"^16.0.0" from react-acceptjs@0.1.2” Code Answer. Could not resolve dependency: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found