当前位置:   article > 正文

node使用react项目启动错误TSError: ⨯ Unable to compile TypeScript:_tserror: unable to compile typescript:

tserror: unable to compile typescript:

1.错误内容

return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/meeting-service/me.ts:195:18 - error TS2769: No overload matches this call.
Type 'FindOperator<unknown>' is not assignable to type 'number | FindOperator<number>'.
Type 'FindOperator<unknown>' is not assignable to type 'FindOperator<number>'.
Type 'unknown' is not assignable to type 'number'.
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project-name@0.0.1 start: `ts-node -r tsconfig-paths/register src/main.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project-name@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

原因:数据类型错误。从错误信息可以看出数据类型转换错误。需要更改数据接收类型。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/119691
推荐阅读
相关标签
  

闽ICP备14008679号