1

What is the difference between

npx create-react-app my-app --typescript

and

npx create-react-app my-apptts --template typescript

?

The latter one is mentioned on the official documentation, but npm start for it leads to errors (that shall not be discussed here - at this question I just want to understand the differences between both commands)

1
  • 1
    I think --template typescript is the "new" way to create a typescript project. Before the v17 of react I was able to create a typescript project with --typescript flag but now It generates me js file instead of ts file. So now you jut have to use --template typescript Commented Nov 22, 2020 at 0:10

1 Answer 1

2

typescript flag has been deprecated since Create React App v4.0.0

We've removed the deprecated typescript flag when creating a new app. Use --template typescript instead. We've also dropped deprecated NODE_PATH flag as this has been replaced by setting the base path in jsconfig.json.

Official Changelog

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the official source. Using --typescript confusingly doesn't give an error.
Thank you. Yes indeed, they should've added some warnings to let us know that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.