3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【yarn】yarn add firebase-tools後にcommand not found: firebaseで実行できない

3
Last updated at Posted at 2020-03-29

はじめに

yarn add firebase-toolsでfirebase用CLIをインストールしたが、コマンドを実行してみると以下のようにコマンドが見つからないエラーになった。その原因と解決方法を下記する。

# firebase login
zsh: command not found: firebase

原因

yarn add firebase-toolsでインストールするとプロジェクトのローカル環境のみにインストールする。

/path/to/project/node_modules/.bin/firebase

解決方法

グローバル環境にインストールし直す

そのプロジェクト以外でも使う予定がある場合は、以下のコマンドを実行することで、firebase loginを使うことができるようになる。

# yarn global add firebase-tools

ローカル環境で使う

そのプロジェクト以外で使う予定がない場合は、以下のコマンドを実行することで、インストールしたプロジェクト直下でyarn firebase loginのようにすることでを使うことができるようになる。

おわりに

個人的にはCLIは共通して使うので前者の方を採用しました!

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?