Typescript gives, “Could not find a declaration file for module 'xmlhttprequest'.”

前端 未结 2 1538
礼貌的吻别
礼貌的吻别 2021-01-28 10:32

Using,

import { XMLHttpRequest } from \'xmlhttprequest\';

On Node I get the following error when I compile with tsc

2条回答
  •  盖世英雄少女心
    2021-01-28 10:51

    Can you try to do npm install @types/xmlhttprequest --save in your command line.

    If it gives you error, then it means that xmlhttprequest library does not support TypeScript.

提交回复
热议问题