LoginSignup
21
11

More than 5 years have passed since last update.

firebase loginでfirebase: command not found と怒られる

Posted at

最近、VuejsやReactやAngularを使ってみたくて、パンダの本やネコの本を買いました。
パンダの本によるとGoogle社が提供するfirebaseを使用すると、チャットサーバの構築が楽になるとかで(Webサーバやデータベースサーバのセットアップが省略できる!しかも無料枠がある)、firebaseを使ってみることにしました。


Firebaseのインストール

$ npm i -g firebase-tools

Firebaseログイン

$ firebase login

-bash: firebase: command not found

調べるとパスがつながってないらしい

$npm get prefix
/Users/ユーザ名/.anyenv/envs/ndenv/versions/8.10.0

.bash_profileに追記

$vim ~/.bash_profile

#firebase
export PATH="$HOME/.anyenv/envs/ndenv/versions/8.10.0/bin:$PATH"

npm get prefixで表示されるユーザ名の後の部分を\$HOME/ ~ /bin:$PATHみたいな感じで追記する。(anyenvでnodeのバージョンを管理しているため長ったらしい。。)

参考:https://stackoverflow.com/questions/23645220/firebase-tools-bash-firebase-command-not-found

変更内容の反映

exec $SHELL -l

Firebaseログイン

$ firebase login
Allow Firebase to collect anonymous CLI usage and error reporting information? y

chromeブラウザが立ち上がり、認証すると...

✔  Success! Logged in as アカウント名@gmail.com

ドットインストールにも最近、Firebaseの動画が追加されてます。
こちらはGUIベースだったかと!
ドットインストール - Firebase

疑問
nodeのバージョンごとにbash_profileを追記が必要なのかな...?

リンク:
Firebase
Firebase CLIリファレンス
パンダの本
ネコの本
ネコの本の著者のtwitterアカウント

21
11
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
21
11