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"

 

posted @ 2019-03-16 01:50  唐安  阅读(11655)  评论(0)    收藏  举报