ts问题处理(2): 'Promise' only refers to a type, but is being used as a value here.


error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.

软件翻译后:  Promise仅指类型,但在这里用作值。是否需要更改目标库?尝试将“lib”编译器选项更改为es2015或更高版本

 解决方案 一 : 把 "target" : "es2015"

 方案二 :  在 'lib' 中添加 "es2015.promise"

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM