Firebase-tools: エミュレータを起動できません

作成日 2017年12月01日  ·  42コメント  ·  ソース: firebase/firebase-tools

FirebaseServeを実行しようとすると--only関数
次のエラーが発生し、ホスティングのみを実行します
functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'

最も参考になるコメント

package.jsonのノードエンジンとは異なるノードバージョンを使用している場合にも同じ問題が発生します
解決:

以下は糸です、npmをお気軽にご利用ください

# install current working directory dependencies
yarn --ignore-engines

# install firebase-tools if u didn't
yarn global add firebase-tools

# install functions-emulator
yarn global add @google-cloud/functions-emulator --ignore-engines

全てのコメント42件

firebase-toolsをインストールしたときにエミュレーターのインストールに失敗したようです(これはオプションの依存関係なので、可能です)。 npm install -g firebase-toolsを再実行して、出力を調べて@google-cloud/functions-emulatorが引き込まれたことを確認してください。

ping? ご返信をお待ちしております。ご連絡いただけない場合は、休業させていただきます。

私は同じことをしました、私は無駄にモジュールをインストールして再インストールしました。

➜firebaseserve-関数のみ

===から提供'..。

⚠機能:エミュレータを起動できません。 エラー:モジュール '@ google-cloud / features-emulator / src / config'が見つかりません
➜npminstall-gfirebase-tools
npm警告非推奨ノード[email protected] :代わりにuuidモジュールを使用してください
/家//.npm-global/bin/firebase-> / home //.npm-global/lib/node_modules/firebase-tools/bin/firebase

===から提供'..。

⚠機能:エミュレータを起動できません。 エラー:モジュール '@ google-cloud / features-emulator / src / config'が見つかりません

こっちも一緒。 数日間このようにされました。 今日の更新後も。

@danielsada@raelmiu試してみてください:

npm Uninstall -g firebase-tools && npm i -g firebase-tools

やった、いくつかの注目すべき警告:
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-v59-linux-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI) (falling back to source compile with node-gyp) make: Entering directory '/home/danielsada/.npm-global/lib/node_modules/firebase-tools/node_modules/grpc/build'
それで

`> @ google-cloud / [email protected] postinstall / home //.npm-global/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator

ノードスクリプト/アップグレード-警告 `

そして最後に、同じエラー

image

同じエラーが発生します。 アンインストールして再インストールしてみました。

誰かがこれを機能させましたか? それでも同じエラーが発生します。

screen shot 2018-01-25 at 12 59 38 pm

こっちも一緒。 インストールされたノード6.11、再インストールされたツールは、まだ機能しません。

v3.17.2で複製できます

みなさん、こんにちは。v3.17.3をお試しいただけますか? @ Mir-Ansar yoursは権限エラーのようです。修正方法に関する情報は次のとおりです: https ://docs.npmjs.com/getting-started/fixing-npm-permissions

.3と.2を試しましたが、同じエラーが発生します:(

これに対する解決策はありますか?

申し訳ありませんが、問題を再現できません。https: //github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/170#issue-278096938に類似しているようです。 したがって、その問題を+1することをお勧めします。

あなたが試すことができる他のことは次のとおりです。

  • npmをアップグレードしてから、アンインストールしてから再インストールします
npm i -g npm
npm unintall -g firebase-tools && npm i -g firebase-tools

私はまったく同じ問題を抱えており、ほとんどの解決策を試しましたが、何も機能しませんでした。 その間に誰かが解決策を手に入れましたか?

同じエラーが発生します

何がこの問題を引き起こしているのか正確にはわかりません。 しかし、これがこの問題の実用的な解決策です。 StackOverflow-Firebase:エミュレータを起動できません

npm install -g @google-cloud/functions-emulatorは私のためにこれを修正しました。

@RyanNewsomは私のためにそれを解決しませんでした。 まだ壊れています。

実用的な解決策はありますか? 私のエミュレーターは機能していましたが、現在は機能していません

私にはいくつかの同様のプロジェクトがあります。1つは機能しており、1つは上記のコメントに従って機能していません。また、Firebaseのデプロイは機能していましたが、現在は不可解に機能していません。 こことstackOverflowの両方で何ヶ月にもわたって同じ運命に苦しんでいる人々の数を考えると、より脆弱でないシステムが適切であるように思われます。

この問題の理由は、ほとんどの場合、firebaseのインストール時にPythonのバージョンが間違っていることです。

Python 2でシェルを使用していることを確認してから、次のコマンドを再実行します。
npm install -g firebase-tools

最新のfirebase-tools(v3.17.5)は、依存関係としてgrpcを削除します。これにより、これらの問題が解決されるはずです。 npm i -g firebase-toolsを実行してアップグレードしてください

私のためにそれを修正しました。

package.jsonのノードエンジンとは異なるノードバージョンを使用している場合にも同じ問題が発生します
解決:

以下は糸です、npmをお気軽にご利用ください

# install current working directory dependencies
yarn --ignore-engines

# install firebase-tools if u didn't
yarn global add firebase-tools

# install functions-emulator
yarn global add @google-cloud/functions-emulator --ignore-engines
⚠  functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'
(node:15281) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'exit' of undefined
    at /usr/local/lib/node_modules/firebase-tools/lib/command.js:82:34
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15281) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15281) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@ddoメソッドを試しましたが、機能しませんでした。

⚠  functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'
(node:15281) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'exit' of undefined
    at /usr/local/lib/node_modules/firebase-tools/lib/command.js:82:34
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15281) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15281) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@ddoメソッドを試しましたが、機能しませんでした。

私の後に働いた:

  1. NVMを使用してノードとNPMを再インストールします
  2. /usr/local/lib/node_modules (またはルートレベルノードからインストールされた以前のグローバルパッケージ)のfirebase-toolsを削除します
  3. sudoなしでfirebase-toolsをインストールする( npm i -g firebase-tools

sdfsdfadf

また、最近ノード8を使用するようにアップグレードし、 firebase serve --only functionsfirebase-tools@google-cloud/[email protected]: The engine "node" is incompatible with this module. Expected version "~6". Got "8.1.0"を完全にインストールできないという問題がありましたが、 --ignore-enginesは本当に役に立ちます-今警告は表示されますが、正常に動作します

[Jest Dev server] $ firebase serve --only functions -p 5000 -o 0.0.0.0
[Jest Dev server]
[Jest Dev server] === Serving from '/Users/xxx/project-name'...
[Jest Dev server]
[Jest Dev server] i  functions: Preparing to emulate functions.
[Jest Dev server] Warning: You're using Node.js v8.1.0 but Google Cloud Functions only supports v6.11.5.

問題は解決しました。Firebaseの使用をやめるだけです。 それでおしまい。

2018年11月14日水曜日、午前1時3分に[email protected]は次のように書いています。

また、最近ノード8を使用するようにアップグレードし、Firebaseに問題がありました
完全にインストールする意思のない関数とfirebase-toolsのみを提供します
@ google-cloud / [email protected] :エンジンの「ノード」は
このモジュールと互換性がありません。 予想されるバージョン「〜6」。 「8.1.0」を取得しましたが、
--ignore-enginesは本当に役に立ちます-今では正常に動作しますが、
警告

[JestDevサーバー] $ firebaseserve--のみの関数-p5000 -o 0.0.0.0
[JestDevサーバー]
[JestDevサーバー] === '/ Users / xxx / project-name'からサービスを提供しています...
[JestDevサーバー]
[JestDevサーバー] i関数:関数をエミュレートする準備をしています。
[Jest Devサーバー]警告:Node.js v8.1.0を使用していますが、Google CloudFunctionsはv6.11.5のみをサポートしています。


コメントしたのでこれを受け取っています。
このメールに直接返信し、GitHubで表示してください
https://github.com/firebase/firebase-tools/issues/552#issuecomment-438375329
またはスレッドをミュートします
https://github.com/notifications/unsubscribe-auth/Acq9nGZycDnglAuFYQiMNNVaQX9XEyTRks5uuwl-gaJpZM4Qx6cx

私を救ってください:
yarn global remove @google-cloud/functions-emulator
yarn global add https://github.com/GoogleCloudPlatform/cloud-functions-emulator#master

firebase-adminやその他のfirebaseパッケージもアップグレードした後、この問題が発生しました。 ノード8で関数を実行しています。 --ignore-enginesを使用してFirebaseをインストールしたことを確認することで、問題を修正できました。

プロジェクトで主にyarnを使用している場合は、firebase-toolsをインストールするときにyarnの代わりにnpmを使用してください。

yarn global remove firebase-tools
npm i - g firebase-tools

私のために働いた:私はMacのDocker内でこの問題に遭遇していました。 何も修正されませんでした。 最終的にMacにインストールし、Dockerのnode_modulesにコピーしました。 それはうまくいった。

ノード8の機能への移行後にも上記の問題が発生します。 前述のように、 --ignore-enginesを使用しますが、まだこの警告が表示されます。

警告:Node.js v8.14.0を使用していますが、Google CloudFunctionsはv6.11.5のみをサポートしています。

@Dygerati私も同じです。

これは私が得るものです、誰かがこの問題を解決しましたか?

functions: Cannot start emulator. Error: Cannot find module './acceleratedmobilepageurl/v1'
(node:16724) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'exit' of undefined
    at C:\....\node_modules\firebase-tools\lib\command.js:82:34
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:16724) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rej
ection id: 2)
(node:16724) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

npm install @google-cloud/functions-emulator --save-devは私のために解決しました

さて、googlecloud-functions-emulatorは「ノードv6.xxのみをサポートします。ノードv8.xxはサポートしません」
https://github.com/GoogleCloudPlatform/cloud-functions-emulator#note

ノードバージョンの選択に関するFirebaseのドキュメントには、ノード8を使用できると記載されています"engines": {"node": "8"}
しかし、そのベータ版です。
https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version

うーん...だから私はnode8を使用できますが、クラウド関数シェルを使用してローカルでテストすることはできません(node8固有の構文を使用している場合)?
私はこの権利を持っていますか?

Firebaseチーム/ Googleチーム、クラウド機能エミュレーターがノード8で動作しないことをドキュメントに記載すると便利です
たとえば、このページでは、 https://firebase.google.com/docs/functions/manage-functions#set_nodejs_versionのようなものがあります

「ランタイムをノード8に設定できますが、google cloud-functions-emulatorでテストすると、node6.xxが使用され、node8固有の構文は機能しません。」

ここでの同様の警告が役立ちます
https://firebase.google.com/docs/functions/local-emulator#install_and_configure_the_cloud_functions_shell

送信したメールにも(2019年2月25日)
件名:[必要なアクション] 4月1日からの新しいCloudFunctionsデプロイメントのランタイムの変更

@julianorinyolとまったく同じ質問でここに来ました-エミュレーターをノード8構文と互換性のあるポイントにする計画はありますか?

ノード8(糸付き)で使用すると、これが私のために働いたものです:
yarn add @google-cloud/functions-emulator --ignore-engines

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