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

后端 未结 15 2285
伪装坚强ぢ
伪装坚强ぢ 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:35

    I'm using node.js v10.16.3. The problem for me was that the typescript compiler was ignoring my tsconfig.json file.

    Three solutions worked for me:

    1. Install ts-node and use that instead to compile and run the file
    2. Do tsc filename.ts --lib "es6", "dom" when you compile the file
    3. Install @types/node which will allow you to run tsc filename.ts without errors.

提交回复
热议问题