LoginSignup
4
2

More than 5 years have passed since last update.

Angularチュートリアル(8.HTTP)でエラー(angular-in-memory-web-api起因でした)

Posted at

Angular のチュートリアルをやっていたのですが、
「8.HTTP」の章でつまづいてしまったので、共有します。

▼ Angular チュートリアル 8.HTTP
https://angular-ja.firebaseapp.com/tutorial/toh-pt6

事象

はじめに、angular-in-memory-web-apiをインストールする手順があるのですが、

npm install angular-in-memory-web-api --save

インストールを行い、チュートリアルを進めていくと、以下のエラーが発生してしまいます。

スクリーンショット 2018-04-25 17.27.52.png

原因

angular-in-memory-web-apiのばーじょんが、0.5→0.6にバージョンアップされていて、
0.6をインストールすると、正常に動作しないようです。

解決方法

1. サンプルソースに合わせて、「./package.json」を以下に変更

vi ./package.json

"angular-in-memory-web-api": "^0.6.0",

  ↓

"angular-in-memory-web-api": "~0.5.0",

2. ライブラリの更新を実施

$ npm update 

これで、正常にチュートリアルが実行できました。

参考情報

こちらも参考にさせていただきました。

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2