-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
added check for typescript template and unsupported node version #7839
Conversation
Hi awaseem! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
We don't have any tests for this functionality. Have you tested it locally and verified things work as expected? |
I'm not going to stop you from writing a test for it. 😀 But I'm okay to merge this as is. If you do want to write a test as a follow up that would be great too! Let me know what you want to do. |
If you're comfortable with merging this, I can create another issue to track the e2e tests and create a PR based on that. |
Thanks! |
This PR related to #7715
Problem
When using the
--typescript
option withcreate-react-app
with an unsupported version node.js ie. from the issue 8.9.4. It creates a React project, but completely ignores the TypeScript template.Whats happening is that before this fix, if you're using an unsupported version of Node.js,
createReactApp.js
falls back to using version0.9.5
. Within0.9.5
, the init script (orscripts/init.js
) there is no code paths that support the TypeScript option. This is why you can still get a react app project, but without TypeScript being configured.Solution
Within
createReactApp.js
I just added a check and error message that tells the user they must upgrade to a supported version to continueTesting
I tested the command using
nvm
, 8.10 fully created a TypeScript project but anything below exits with the following message:Please let me know if you have any questions!