将create-react-app从javascript迁移到typescript

一、删除全部的 node_modules

  注意: 确保之前没有在目录下执行过 tsc --init。 如果执行过,删掉 tsconfig.json ,  src/ react-app-env.d.ts   这两个文件都删掉。没有更好。

二、安装模块

  

npm install --save typescript @types/node @types/react @types/react-dom @types/jest

  

三、npm install , 安装其他被删掉的模块

四、npm start 启动

原文地址:https://www.cnblogs.com/muamaker/p/14794619.html