webpack TS2304 Cannot find name 'Map', 'Set', 'Promise'

后端 未结 15 2151
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 07:07

I have the following webpack.config.js

var path = require(\"path\");
var webpack = require(\'webpack\');

module.exports = {
  entry: {
    \'ng2-auto-comple         


        
15条回答
  •  有刺的猬
    2020-12-01 07:46

    For me the solution was to install @types/node:

    yarn add @types/node --dev
    

    Or if you prefer npm:

    npm install @types/node --dev
    

    However, I suppose that if you plan to continue using "Map", "Set" or "Promise", it's good practice to include "es6" in the "lib" array in tsconfig.json anyways.

提交回复
热议问题