LoginSignup
0
0

Flutterfireの環境設定

Posted at

Flutterでのアプリ開発時にFirebaseを利用する際、環境設定でつまづいた。

flutterfireコマンドプログラムのアクティベート

以下のコマンドで、flutterfireをアクティベートする。

dart pub global activate flutterfire_cli

本来であれば上記で問題がないが、環境設定がされておらず下記エラーが発生した。

Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):
  export PATH="$PATH":"$HOME/.pub-cache/bin"
Activated flutterfire_cli 0.2.1+1.

解決方法

エラー内容に記載の通り、環境にPathを通す。
※投稿者はMac OSを利用しており、「.bashrc」などではなく、「.zshrc」に記載した。
下記コマンドで、「zshrc」ファイルを開く。

vi ~/.zshrc

「zshrc」ファイルの中に、エラー内容で指定されていた下記コマンドを追記する。

export PATH="$PATH":"$HOME/.pub-cache/bin"

上記を実行した後、一度ターミナル/コマンドプロンプトを再起動する。
※再起動しないと、環境Pathが反映されない!

再度以下コマンドを実行し、エラーが発生しないことを確認する。

dart pub global activate flutterfire_cli
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