Skip to content
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

Creating a TypeScript app with --typescript option does not work #5853

Closed
nareshbhatia opened this issue Nov 19, 2018 · 5 comments
Closed

Creating a TypeScript app with --typescript option does not work #5853

nareshbhatia opened this issue Nov 19, 2018 · 5 comments

Comments

@nareshbhatia
Copy link

Is this a bug report?

Yes

Did you try recovering your dependencies?

N/A

Which terms did you search for in User Guide?

TypeScript

Environment

Environment Info:

System:
OS: macOS Sierra 10.12.6
CPU: x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
Binaries:
Node: 11.2.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.102
Firefox: 60.0.2
Safari: 12.0.1
npmPackages:
react: ^16.6.3 => 16.6.3
react-dom: ^16.6.3 => 16.6.3
react-scripts: 2.1.1 => 2.1.1
npmGlobalPackages:
create-react-app: Not Found

Steps to Reproduce

(Write your steps here:)

  1. npx create-react-app my-app --typescript

Expected Behavior

A TypeScript app is created with .tsx files

Actual Behavior

An ES6 app is created with .js files

Reproducible Demo

N/A

@miraage
Copy link

miraage commented Nov 19, 2018

Your local create-react-app "binary" must be quite old (v1.x). Try to update it to the latest version npm install --global create-react-app.

@brunolemos
Copy link
Contributor

Hi! Please run npx create-react-app --version, make sure it's at least 2.1.

If not, run npm i -g create-react-app like @miraage mentioned.

After doing this, it will work as expected.

@nareshbhatia
Copy link
Author

Thanks @miraage & @brunolemos. Turns out that I did not have create-react-app installed in global. Somehow I thought that it was not required when using npx. As soon as I installed it, I was able to create a typescript app.

Thanks for your help.

@brunolemos
Copy link
Contributor

@nareshbhatia it's not required, but sometimes it ends up using an existing version on your machine instead of the newest one

@nareshbhatia
Copy link
Author

Ah, I see. Thanks for clarifying, @brunolemos.

@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants