LoginSignup
0
0

More than 5 years have passed since last update.

ionic3でngx-translateを使おうとするとエラーになる

Last updated at Posted at 2017-08-22

2017/8/20時点のお話です。
angular2以降の多言語対応モジュールであるngx-translateをインストールするとエラーになります。

Typescript Error
Cannot find module '@angular/common/http'.
node_modules/@ngx-translate/http-loader/src/http-loader.d.ts

上記はionicの公式が書いてくれた導入のドキュメント。
この通りにやってもエラーで動きません。

で、何が理由かというと、ionic3が指定しているAngularのバージョンが古いんですね。
手順どおりで正しく動かすにはAngularが4.3.0以上である必要があります。

というわけでpackage.jsonを変えます。

ngx-translate/http-loader@0.1.0

これで動くようになるはず。
まあionicが4になったらここらへんも直りそうですけどね。

0
0
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
0
0