To fix Promise is not recolized in TypeScript, we can choose to use a lib:

npm i @types/es6-promise

we can also use built-in libs:

{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": true,
"sourceMap": true,
"strictNullChecks": true,
"noEmitOnError": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"lib": ["es6"],
"skipLibCheck": true
},
"exclude": [
"client/node_modules"
]
}

Inside "es6" have Promise already, so that we don't need to install other devdependices.

[Typescript] Installing Promise Type Definitions Using the lib Built-In Types的更多相关文章

  1. Hex-Rays decompiler type definitions and convenience macros

    /****************************************************************************************** Copyrigh ...

  2. The repository for high quality TypeScript type definitions

    Best practices This is a guide to the best practices to follow when creating typing files. There are ...

  3. [TypeScript] Type Definitions and Modules

    For example you are building your own module, the same as Lodash: my-lodash.d.ts declare module &quo ...

  4. [TypeScript] Avoid any type

    To avoid using "any" type is a best pratice. The reason for that is it disable the power o ...

  5. [TypeScript] Use TypeScript’s never Type for Exhaustiveness Checking

    TypeScript 2.0 introduced a new primitive type called never, the type of values that never occur. It ...

  6. [TypeScript] Represent Non-Primitive Types with TypeScript’s object Type

    ypeScript 2.2 introduced the object, a type that represents any non-primitive type. It can be used t ...

  7. [TypeScript] Define Custom Type Guard Functions in TypeScript

    One aspect of control flow based type analysis is that the TypeScript compiler narrows the type of a ...

  8. [TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)

    This lesson shows you how to install TypeScript and run the TypeScript compiler against a .ts file f ...

  9. 【typedef】Type definitions 自定义类型

随机推荐

  1. [转载] C 陷阱与缺陷( C traps and Pitfalls )

    本文转自 https://www.xuebuyuan.com/1951579.html 自己找工作过程中复习过的书包括<C traps and Pitfalls>,<编程珠玑> ...

  2. Android开发进度05

    1,今日:目标:完成后台用户的增删改查 2,昨天:完成登录和注册功能 3,收获:熟练了SQLite操作 4,问题:无

  3. STM32 关于头文件路径没添加错误问题(cannot open source input file "spi.h": No such file or directory)

    error:  #5: cannot open source input file "spi.h": No such file or directory 1.出现这种问题,首先要确 ...

  4. 一行代码解决IE兼容性问题

    在网站开发中不免因为各种兼容问题苦恼,针对兼容问题,其实IE给出了解决方案Google也给出了解决方案百度也应用了这种方案去解决IE的兼容问题 百度源代码如下 <!Doctype html> ...

  5. DQL查询语句使用(select)

      9)DQL查询语句使用   SELECT语句在PL/SQL中使用,必须 采用下面用法:     select id INTO 变量   from t001 where id=5;    将记录字段 ...

  6. Run Nutch In Eclipse on Linux and Windows nutch version 0.9

    Running Nutch in Eclipse Here are instructions for setting up a development environment for Nutch un ...

  7. HDU——T 1054 Strategic Game

    http://acm.hdu.edu.cn/showproblem.php?pid=1054 Time Limit: 20000/10000 MS (Java/Others)    Memory Li ...

  8. &lt;pre&gt;标签

     <pre>标签最主要的认识就是预格式化文本,被包围在 pre 元素中的文本一般会保留空格和换行符.而文本也会呈现为等宽字体.经经常使用于在网页中显示计算机源码. 1.格式化文本举例 &l ...

  9. PCA(Principal Components Analysis)主成分分析

    全是图片..新手伤不起.word弄的,结果csdn传不了..以后改. .

  10. Understanding The Complete Story of Postback in ASP.NET

    https://docs.microsoft.com/zh-cn/dotnet/api/system.web.ui.page.ispostback?view=netframework-4.7 http ...