Angular 2 : No NgModule metadata found

后端 未结 28 1483
盖世英雄少女心
盖世英雄少女心 2020-11-30 05:31

I\'m brand new to Angular 2 and attempting to follow along with a video tutorial I found. Despite following all of the steps, Angular just won\'t work; I get the following e

28条回答
  •  温柔的废话
    2020-11-30 05:44

    I found that the cause of this problem in my case, was that I've combined my Angular app with a node.js application in the same source tree, and in the root tsconfig.json I had:

    "files": [ "./node_modules/@types/node/index.d.ts" ]

    I changed this to

    "compilerOptions": { "types": ["node"] }

    And then to prevent node types being uses in your angular app, add this to tsconfig.app.json:

    "compilerOptions": { "types": [] }

提交回复
热议问题