- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPM 8 install of craco giving peer dependency issue when used with react-scripts 5.x #459
Comments
Thanks for the great suggestion @gauravshah27! Although I see what you're getting at, I think it might be better to hold off until the 7.0.0 release. I plan to release craco 7 within the next week because the latest alpha version is stable enough to be used with CRA 5. The things that remain on the project board are mainly just extra enhancements or other issues that may have already existed with older craco versions, and those can be added in a future minor update. The primary goal of craco 7 is simply to support CRA 5, which it seems like the alpha versions are doing. I apologize for the long delay, but I think we're finally reaching a point where craco 7 can be released. I plan on making a couple of final adjustments and finding a solution to #447 over the next couple of days, and with a release so close, it wouldn't really make sense to support CRA 5 with such an old version of craco and have people mess with their configs just to have to put it back shortly after. Let me know what you think! |
@dilanx I feel much better after reading your response. It makes a lot of sense if you are planning to release the enhancements, as you mentioned, in future minor updates and its best to wait for the craco 7 release if the release is happening within the next week. So I agree with you and will wait eagerly for the release to drop. Thanks again for the quick turn around and for all the work that you are putting in. If its ok - I will leave this issue open until the craco 7 release drops and then will come back and close it after we have the release and we have confirmed that it works as expected. |
@dilanx just reaching out to see if we have a more concrete release date for the 7.x release ? |
@gauravshah27 it should be out by Monday! |
Im stil getting this issue with a fresh install |
Same here, trying to add @dilanx Is there any fix for this? |
When I run
npm install
on my project that usesreact-scripts 5.0.1
andcraco 6.4.5
I get the following error because of the change in the legacy peer deps behavior ofnpm 8
:I have gone through the following pieces of information:
craco-antd
being referenced in my tree and hence I opened this issue.I have updated my
craco.config.js
to be compatible with webpack 5 and the changes that brings in. I primarily use craco to help with the creation of named vendor bundles as well as to include the svg optimization (svgo) for @svgr/webpack plugin in my application.With Node.js 14 (and therefor npm 6 that comes with it) about to be marked end of life (30 Apr 2023) - we have started moving to Node.js 16 which pulls in npm 8 and that is when this issue started popping up.
Given that its been more than 6 months since react-scripts came out with 5.0.1 release and we still don't have a release version of craco that is completely ready, is it possible to have a patch release where the peerDependency of react-scripts is bumped so that https://github.com/dilanx/craco/blob/master/packages/craco/package.json#L37 can look as follows:
This should help people move to the latest version of react-scripts (5.0.1) and npm 8. I do understand that people will have to migrate over their craco.config.js to be compatible with webpack 5 but in most cases that just is writing more verbose code in the config file rather than making use of friendly apis that craco provides. However, that would be a trade-off that probably makes sense and buys you time to work on a quality release of craco 7.x, while the community can continue moving forward with the latest release of react-scripts and npm without having to hunt for alternatives to craco. This would be a win-win in my opinion :)
@dilanx I will be more than happy to contribute this change if you are open to it. Please comment here if you have any other alternatives that can work better in this scenario.
The text was updated successfully, but these errors were encountered: