LoginSignup
1
0

More than 1 year has passed since last update.

WSL環境でfirebase init, firebase deployが出来ない

Posted at

WSLでfirebase init, firebase deployが出来ない!!!!!

firebase init, firebase deployが出来なくて2日悩まされました。
他のfirebase系コマンドを試していないので、他のコマンドも使えない物が多いと思います

結構特殊なパターンだと思うので、複数解決方法を記述しておきます。

エラー内容としては以下

initのパターン
shell
firebase init
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
...
? Please select an option: Use an existing project

Error: Failed to list Firebase projects. See firebase-debug.log for more info.

deployのパターン
shell
firebase deploy --only hosting
...
...
Error: Failed to get Firebase project ○○○○○. Please make sure the project exists and your account has permission to access it.

掘り下げるべく、--debugをつけて実行してみると・・・

shell
Timeout reached making request to https://firebase.googleapis.com/v1beta1/projects?pageSize=100

googleAPIへのGETで詰まってる。
Windows環境のfirebase-toolsでは問題なく動いているので、WSL内でのみtimeoutしてるみたいだ。

解決方法1

この解決方法は調べても全く出てこなかった。。。
PC初期化直後から発生していたバグなので、開発パートナーと設定を合わせる所で発見した。

私の環境では、DNSを8.8.8.8 8.8.4.4に設定している。
ネットワーク設定にて、HTTPS経由のDNSの部分を、「暗号化優先」に変える事で直った。Windows11環境では、「オン(自動テンプレート)」
image.png

解決方法2

シンプルに認証切れの場合があるので、再ログインしてみよう

shell
firebase logout && firebase login

解決方法3

WindowsへのPATHを通す。
詳しい原因は分からないが、これで直っている人が多々居た。

環境に合わせて追記する。

.bash_profile/.bashrc/.zshrc
export PATH=$PATH:/mnt/c/Windows/System32
1
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
1
0