Angular2 Tutorial (Tour of Heroes): Cannot find module 'angular2-in-memory-web-api'

前端 未结 29 2265
青春惊慌失措
青春惊慌失措 2020-11-29 06:25

I have followed the Tutorial. After changing app/maint.ts in the Http chapter I get the error when starting the app via command line:

ap

29条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 07:04

    Latest fix as of this date, is to

    1. replace all instances of "angular2-in-memory-web-api" with "angular-in-memory-web-api".
    2. Change package.json dependency version from "angular-in-memory-web-api": "0.0.20" to "angular-in-memory-web-api": "0.1.0" and "zone.js": "^0.6.23" to "zone.js": "^0.6.25"
    3. In systemjs.config.js, change the path for index.js. It should look like:
      'angular-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }

提交回复
热议问题