zoukankan      html  css  js  c++  java
  • ts-react 运行报错

    ts+react

    如果感兴趣typescript的基础代码学习可以参考我的gitlab

    安装命令

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

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

    切换到ts-react并运行
    yarn start

    运行时报了如下错误

    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
    

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

  • 相关阅读:
    delphi参数传递
    Delphi OO
    Delphi Excel
    Delphi Register
    西安前端交流会
    web前端开发教程系列-4
    web前端开发教程系列-3
    web前端开发教程系列-2
    web前端开发教程系列-1
    露个脸
  • 原文地址:https://www.cnblogs.com/lisaShare/p/12573490.html
Copyright © 2011-2022 走看看