-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] Unable to resolve dependency in Create React App Typescript template #2128
Comments
This version of react-scripts requires typescript 3, and you’re using typescript 4. To make your dep graph valid, you’ll have to downgrade typescript, or upgrade to a version of react-scripts that allows typescript 4, if it exists. |
Is this a bug with Create React App then? The install works with Yarn though. Is NPM being stricter about dependencies than other package managers? |
No, it’s a bug with your package.json, since that’s what declares typescript. However, if CRA is generating that, then yes, it’s a bug in CRA. npm 7 properly checks peer deps on install (altho it unfortunately doesn’t fail by default when there’s a peer dep issue like this), and i don’t believe any other npm package CLIs do. |
Thanks for the explanation. Looks like this was filed as facebook/create-react-app#9995. |
facebook/create-react-app#9964 seems like it will fix it, once merged and released. Closing this in favor of the linked issue and PR. |
Hello I know it's been a while, what version was this fixed on? |
@lalberto8085 no version of npm; if you click on the CRA PR, and on the commit that merged it, you'll see it's not released there yet. |
This issue is still present. My Environments:OS: MacOS 11.2.3 I was able to resolve it by downgrading typescript version in package.json
|
Current Behavior:
Based off the feedback in #2000, I'm filing a unique bug on this. In an empty React Applicaiton created with the
create-react-app
Typescript template,npm install
fails with the following:Expected Behavior:
npm install
should succeedSteps To Reproduce:
Environment:
The text was updated successfully, but these errors were encountered: