Angular2 5 minute install bug - require is not defined

后端 未结 7 1724
一个人的身影
一个人的身影 2020-11-28 12:22

I\'m doing the Angular2 5 minute quick start.

About half way through the tutorial now, I have the following files setup correctly:

  • index.html,
7条回答
  •  天命终不由人
    2020-11-28 13:05

    I found that the reason mine brought an error was due module set as "commonjs" in my tsconfig.json file, changing it to system fixed it, now it looks like below

    {
      "compilerOptions": {
            "target": "es5",
            "module": "system",
            "declaration": false,
            "noImplicitAny": false,
            "removeComments": true,
            "noLib": false,
            "emitDecoratorMetadata": true,
            "experimentalDecorators": true,
            "sourceMap": true
        },
      "exclude": [
        "node_modules"
      ]
    }
    

    EDIT This answer was based on Angular 2 beta 17 .Based on the time of this answer and the rapid changes angular 2 has undergone, this may not work anymore.

提交回复
热议问题