When I run the command
npx create-react-app my-app --template typescript
only a JS project is created, no .tsx
file whatsoever.
[email protected]
or higher.my-app
's package.json
is only 0.9.5
.[email protected]
, which is latest.My environment:
It sounds like you may have a very old copy of create-react-app
installed globally, so npx
is using that one rather than the latest. To remove it, use:
npm uninstall -g create-react-app
Then npx create-react-app
will pick up the latest one, which should handle that command line correctly.
(I tested this by installing an old version globally, then using npx
and sure enough, it was the old version that ran. I installed v1.0.0 and indeed, it didn't do anything with the --template
argument. But even it installed react-scripts
v5.)