Firebase-tools: verifyDeveloperNodeModules()が「firebase-admin」の検出に失敗する

作成日 2019年05月09日  ·  26コメント  ·  ソース: firebase/firebase-tools

関連する問題

1243および#1258

[必須]バージョン情報

ノード: 8.16.0

firebase-functions: 2.3.0

firebase -tools: 6.9.1(注: 6.8.0で動作します)

firebase -admin: 7.3.0

私はこれをWindows10で実行しています。

[必須]テストケース


firebase initと関数を使用して新しく生成されたFirebaseプロジェクト。

[必須]再現手順

  1. npm run start (またはfirebase functions:shell )を実行します

[必須]期待される動作


エミュレータが正しく起動します

[必須]実際の動作

次のログが表示されます。

!  The Cloud Functions emulator requires the module "firebase-admin" to be installed. This package is in your package.json, but it's not available. You probably need to run "npm install" in your functions directory.
i  functions: Your functions could not be parsed due to an issue with your node_modules (see above)

関数を正常にデプロイできましたか?


はい、デプロイは正常に機能します。 デプロイされた関数(Hello World)も

emulator-suite bug

最も参考になるコメント

これはfirebase-toolsバージョン6.9.06.9.1バグです。 解決策は、今のところ6.8.0にダウングレードすることです。

npm install -g [email protected]

参照: https

全てのコメント26件

この問題にラベルを付ける方法がわからなかったので、人間がトリアージできるようにラベルを付けました。 しっかりとハングアップします。

エミュレーションが実装される場所であるfirebase-toolsに移動します。

エミュレータは[email protected]ます。 この問題は、#1243および#1258に関連している可能性があります

同じ問題が発生している:

✔  functions: Using node<strong i="6">@8</strong> from host.
✔  functions: Emulator started at http://localhost:5001
i  functions: Watching "/home/yerzhan/projects/askimam/functions" for Cloud Functions...
⚠  The Cloud Functions emulator requires the module "firebase-admin" to be installed. This package is in your package.json, but it's not available. You probably need to run "npm install" in your functions directory.
i  functions: Your functions could not be parsed due to an issue with your node_modules (see above)
firebase -V
6.9.1
  "dependencies": {
    "firebase-admin": "^7.3.0",
    "firebase-functions": "^2.3.0"
  },

ただし、firebase-adminパッケージはnode_modulesに存在します。

[2019-05-09T09:19:26.091Z] ----------------------------------------------------------------------
[2019-05-09T09:19:26.093Z] Command:       /home/yerzhan/node-v8.12.0-linux-x64/bin/node /home/yerzhan/node-v8.12.0-linux-x64/bin/firebase emulators:start --debug
[2019-05-09T09:19:26.093Z] CLI Version:   6.9.1
[2019-05-09T09:19:26.093Z] Platform:      linux
[2019-05-09T09:19:26.093Z] Node Version:  v8.12.0
[2019-05-09T09:19:26.094Z] Time:          Thu May 09 2019 15:19:26 GMT+0600 (+06)
[2019-05-09T09:19:26.094Z] ----------------------------------------------------------------------

[2019-05-09T09:19:26.099Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2019-05-09T09:19:26.099Z] > authorizing via signed-in user
[2019-05-09T09:19:26.100Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[2019-05-09T09:19:26.100Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token  
 <request body omitted>
[2019-05-09T09:19:26.891Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=utf-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Thu, 09 May 2019 09:19:26 GMT, server=scaffolding on HTTPServer2, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
[2019-05-09T09:19:26.901Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/azan-kz-ask-imam  

[2019-05-09T09:19:28.625Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Thu, 09 May 2019 09:19:28 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=923, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
i  Starting emulators: ["functions"]
✔  functions: Using node<strong i="5">@8</strong> from host.
[2019-05-09T09:19:28.637Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/674391970261:getServerAppConfig  

[2019-05-09T09:19:29.356Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Thu, 09 May 2019 09:19:29 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", accept-ranges=none, transfer-encoding=chunked
✔  functions: Emulator started at http://localhost:5001
i  functions: Watching "/home/yerzhan/projects/askimam/functions" for Cloud Functions...
[2019-05-09T09:19:29.813Z] Functions runtime initialized.
[2019-05-09T09:19:29.813Z] Disabled runtime features: undefined
⚠  The Cloud Functions emulator requires the module "firebase-admin" to be installed. This package is in your package.json, but it's not available. You probably need to run "npm install" in your functions directory.
i  functions: Your functions could not be parsed due to an issue with your node_modules (see above)

私は同じ解決策を見つけました:
次のようなエイリアスコマンドを使用できます:「yarnserve」または「npmserve」
「scripts」ブロックのpackages.jsonから呼び出します

ここで同じ問題! 3時間の間に回避策を見つけようとしましたが、成功しませんでした。
今日は、firebase-adminをグローバルnpmに追加することを考えましたが、機能するかどうかはわかりません。
@namcoderであなたの提案を試してみます

@diogolessa firebase -tools

確かに、可能性があります...より良いアプローチのように見えます。 ただし、私のような初心者のために、すべての最新バージョンが正常に機能していると便利です。 ありがとう@ExtraBB

ここでも同じです...それはLinuxでも起こります。

編集:「修正」のダウングレードが確認されました。

この問題が発生していたので、firebase-toolsを削除し、firebase-tools @ 6.8.0を再インストールしました

同じ問題..ダウングレードはそれを機能させる唯一の方法です

現在機能している設定のみ
firebase-functions:2.3.0
firebase-tools:6.8.0
firebase-admin:7.3.0

みなさん、この問題が原因で問題が発生していることをお詫び申し上げます。 今のところ、パッチの作業中に6.8.0ダウングレードすることをお勧めします。

この問題は、 slowRequireResolveを使用する必要があるverifyDeveloperNodeModules()でネイティブrequire.resolveを使用していることが原因です。 ネイティブrequire.resolve他の使用法も、同じ問題に悩まされます。

require.resolveがテストで実行したときにfirebase-toolsの開発依存関係に解決されたため、これはテストで検出されませんでした。そのため、 require.resolveslowRequireResolve

これはfirebase-toolsバージョン6.9.06.9.1バグです。 解決策は、今のところ6.8.0にダウングレードすることです。

npm install -g [email protected]

参照: https

更新していただきありがとうございます。 6.8.0へのダウングレードは私たちのために働いた

さてさて、私たちはこれに対する修正をマージしました。これは今日6.9.2ます。 リリースする前に#1265の修正を待つかもしれませんが、それでもうまくいかない場合は、そのままで終了します。 バグが発生したら、このバグを閉じますが、問題が引き続き発生する場合は、再度開いてください。

#1263で修正

この修正により、バージョン6.9.2がリリースされました。

次のエラーが発生し、この新しいリリースに関連しているかどうか疑問に思います。

AssertionError [ERR_ASSERTION]: missing path
    at Module.require (module.js:595:3)
    at require (internal/module.js:11:18)
    at InitializeFirebaseAdminStubs

6.8.0から6.9.2にアップグレードし、現在次のように表示されています。

機能:ホストからnode @ 8を使用し

! Cloud Functionsエミュレーターでは、開発の依存関係としてモジュール「firebase-functions-test」をインストールする必要があります。 これを修正するには、functionsディレクトリで「npminstall --save-devfirebase-functions-test」を実行します。
i関数:node_modulesの問題により、関数を解析できませんでした(上記を参照)

6.9.2にアップグレードした後、多くのエラーが発生します。

  1. https://github.com/firebase/firebase-tools/issues/1106
  2. https://github.com/firebase/firebase-tools/issues/1265
    そして、既存のバグに取り組もうとした後、さらにいくつかのバグがあります。
    このアップグレードははるかに壊れています。 6.8.0にダウングレードする必要がありました

この修正により、バージョン6.9.2がリリースされました。

修正は固執しませんでした。 "firebase-tools": "^6.10.0"このエラーが発生しています。

Cloud Functionsエミュレーターでは、モジュール「firebase-admin」がバージョン> 7.0.0である必要があるため、バージョンが古すぎます。 関数ディレクトリで「 npminstallfirebase-admin @ latest 」を実行すると、おそらくこれを修正できます。

インストール時の自動アップグレードを防ぐために、今のところpackage.json依存関係から^を削除しました。

"firebase-tools": "^6.8.0", // before
"firebase-tools": "6.8.0", // after

@diogolessa firebase -tools

ありがとう、それは私のために働いた

このページは役に立ちましたか?
0 / 5 - 0 評価