首页 > 其他 > 详细

ts-react 运行报错

时间:2020-03-26 12:27:22      阅读:275      评论:0      收藏:0      [点我收藏+]

ts+react

安装命令

全局安装react
npm install -g create-react-app

搭建ts框架
create-react-app ts-react --typescript

切换到ts-react并运行
yarn start

运行时报了如下错误

解决办法:将package.json中,"typescript": "~3.7.5"版本,更新ts到"typescript": "^3.8.3" npm install typescript@3.8.3 -S

TypeScript error in E:/demo/ts/base-typescript/ts-react-basic/node_modules/@types/testing-library__react/node_modules/pretty-format/build/index.d.ts(7,13):
‘=‘ expected.  TS1005

     5 |  * LICENSE file in the root directory of this source tree.
     6 |  */
  >  7 | import type * as PrettyFormat from ‘./types‘;
       |             ^
     8 | /**
     9 |  * Returns a presentation string of your `val` object
    10 |  * @param val any potential JavaScript object

ts-react 运行报错

原文:https://www.cnblogs.com/lisaShare/p/12573490.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!