typescript - npx create-react-app my-app --template typescript is not generating any TypeScript files
问题描述
npx create-react-app my-app --template typescript
is not generating any TypeScript files, it just making a normal JS project.
I have globally uninstalled create-react-app from my npm as I have seen that suggested as a solution to this before.
Logs:
$ npx create-react-app my-app --template typescript
npx: installed 80 in 7.19s
Creating a new React app in C:\code\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
> core-js@2.6.12 postinstall C:\code\my-app\node_modules\babel-preset-react-app\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@2.6.12 postinstall C:\code\my-app\node_modules\babel-register\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@2.6.12 postinstall C:\code\my-app\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
+ react@0.14.9
+ react-scripts@0.9.5
+ react-dom@0.14.9
added 912 packages from 647 contributors in 50.852s
Success! Created my-app at C:\code\my-app
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd my-app
npm start
Happy hacking!
The created project structure files are all .js, and there is no TypeScript in the package.json.
解决方案
推荐阅读
- c# - Start process with QUARTZ.NET
- eclipse - getting following error on Adding org.glassfish.jersey.archetypes in eclipse version Oxygen
- ios - 从键值对数组创建一个键数组
- wpf - WPF Stackpanel Children unable to select using foreach
- regex - The cypher regex operator in neo4j is giving unexpected behavior
- php - Menu Drop-Down using MySQL enum in Laravel
- laravel - Run asynchronous code in laravel controller
- javascript - $_$wf is not defined wallaby.js and puppeteer interference
- java - Greek characters show as question marks or boxes when exporting from an old Access database
- file - How to copy a byte-range into a new output file in Rust?