Firebase-tools: #のプロパティ設定を設定できません<object>ゲッターしかない</object>

作成日 2020年05月28日  ·  35コメント  ·  ソース: firebase/firebase-tools

【必須】環境情報

firebase -tools: 8.4.0

プラットフォーム: Windows

[必須]テストケース

index.js

const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();

exports.testFunction = functions.https.onRequest(async (req, res) => {

  console.log(req.body);

});

[必須]再現手順

最初のエミュレートは正常に機能しました
最初とその後のデプロイは正常に機能します
関数は本番環境で正常に機能します
ローカルでエミュレートできなくなりました。

コンソール出力:

i  emulators: Starting emulators: functions
+  functions: Using node<strong i="23">@10</strong> from host.
i  functions: Watching "D:\path\to\functions" for Cloud Functions...
!  functions: Cannot set property config of #<Object> which has only a getter
!  Your function was killed because it raised an unhandled error.

この問題に加えて、何が起こったのかは出力からは明らかではありません。 デバッグログには何もありません。

[必須]期待される動作


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

[必須]実際の動作


エミュレータが起動しない

emulator-suite functions bug

最も参考になるコメント

修正はfirebase-toolsバージョン8.4.1でリリースされました

全てのコメント35件

@ boddy33ハァッfirebase-debug.log以外に絶対に何もありませんか? または、 --debugてコマンドを実行した場合はどうなりますか?

エミュレータランタイムのバグのようです。

[debug] [2020-05-28T19:48:29.510Z] ----------------------------------------------------------------------
[debug] [2020-05-28T19:48:29.511Z] Command:       /path/to/node-v12.16.3-darwin-x64/bin/node /path/to/node/bin/firebase functions:shell
[debug] [2020-05-28T19:48:29.511Z] CLI Version:   8.4.0
[debug] [2020-05-28T19:48:29.512Z] Platform:      darwin
[debug] [2020-05-28T19:48:29.512Z] Node Version:  v12.16.3
[debug] [2020-05-28T19:48:29.512Z] Time:          Thu May 28 2020 20:48:29 GMT+0100 (British Summer Time)
[debug] [2020-05-28T19:48:29.512Z] ----------------------------------------------------------------------
[debug] [2020-05-28T19:48:29.512Z] 
[debug] [2020-05-28T19:48:29.518Z] > 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"]
[debug] [2020-05-28T19:48:29.519Z] > authorizing via signed-in user
[debug] [2020-05-28T19:48:29.519Z] [iam] checking project firebase-project for permissions ["firebase.projects.get"]
[debug] [2020-05-28T19:48:29.521Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/firebase-project:testIamPermissions  
 {"permissions":["firebase.projects.get"]}
[debug] [2020-05-28T19:48:30.208Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Thu, 28 May 2020 19:48:30 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=563","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[warn] ⚠  Your requested "node" version "10" doesn't match your global version "12" {"metadata":{"emulator":{"name":"functions"},"message":"Your requested \"node\" version \"10\" doesn't match your global version \"12\""}}
[debug] [2020-05-28T19:48:30.226Z] [functions] Watching "/path/to/app" for Cloud Functions...
[debug] [2020-05-28T19:48:30.233Z] DEBUG: [worker-pool] addWorker(~diagnostic~)
[debug] [2020-05-28T19:48:30.234Z] DEBUG: [worker-pool] Adding worker with key ~diagnostic~, total=1
[debug] [2020-05-28T19:48:30.234Z] DEBUG: [worker-pool] submitWork(triggerId=)
[debug] [2020-05-28T19:48:30.234Z] DEBUG: [worker-~diagnostic~-2336cd45-d0fd-4176-8826-39b0820a42c8]: Assigning socketPath: /var/folders/5v/7080hjcx6vb_d52z1clvxqd80000gn/T/fire_emu_24604.sock
[debug] [2020-05-28T19:48:30.234Z] DEBUG: [worker-~diagnostic~-2336cd45-d0fd-4176-8826-39b0820a42c8]: BUSY
[debug] [2020-05-28T19:48:30.430Z] DEBUG: [runtime-status] [24604] Functions runtime initialized. {"cwd":"/path/to/app","node_version":"12.16.3"}
[debug] [2020-05-28T19:48:30.431Z] DEBUG: [runtime-status] [24604] Disabled runtime features: undefined
[debug] [2020-05-28T19:48:30.434Z] DEBUG: [runtime-status] [24604] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.12.1","resolution":"/path/to/app/node_modules/firebase-admin/lib/index.js"}
[debug] [2020-05-28T19:48:30.440Z] DEBUG: [runtime-status] [24604] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.2","resolution":"/path/to/app/node_modules/firebase-functions/lib/index.js"}
[debug] [2020-05-28T19:48:30.441Z] DEBUG: [runtime-status] [24604] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}]
[debug] [2020-05-28T19:48:30.499Z] DEBUG: [runtime-status] [24604] Checked functions.config() {"config":{}}
[debug] [2020-05-28T19:48:30.499Z] DEBUG: [runtime-status] [24604] Error in handleMessage: {"frb":{"cwd":"/path/to/app","projectId":"firebase-project","triggerId":"","emulators":{},"socketPath":"/var/folders/5v/7080hjcx6vb_d52z1clvxqd80000gn/T/fire_emu_24604.sock"},"opts":{"nodeBinary":"/path/to/node-v12.16.3-darwin-x64/bin/node"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
    at /path/to/node-v12.16.3-darwin-x64/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:455:19
    at Generator.next (<anonymous>)
    at fulfilled (/path/to/node-v12.16.3-darwin-x64/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[warn] ⚠  functions: Cannot set property config of #<Object> which has only a getter {"metadata":{"emulator":{"name":"functions"},"message":"Cannot set property config of #<Object> which has only a getter"}}
[warn] ⚠  Your function was killed because it raised an unhandled error. {"metadata":{"emulator":{"name":"functions"},"message":"Your function was killed because it raised an unhandled error."}}
[debug] [2020-05-28T19:48:30.504Z] DEBUG: [worker-~diagnostic~-2336cd45-d0fd-4176-8826-39b0820a42c8]: exited
[debug] [2020-05-28T19:48:30.504Z] DEBUG: [worker-~diagnostic~-2336cd45-d0fd-4176-8826-39b0820a42c8]: FINISHED

これはv8.xxの問題のようです。v7.16.2へのダウングレードは機能します。

これは、今日のfirebase-functionsリリースに関連している可能性があると感じています。
https://github.com/firebase/firebase-functions/releases/tag/v3.6.2

私はごく最近の何かになるはずです。 他の問題を見ると、v8.xxエミュレーターはある時点で機能していました(そしてv8.4.0は1週間前にリリースされました)。

こんにちは、
同じ問題があります:)

ありがとう@ uditha-atukoralaそれは動作します:)

パッケージ[email protected]をインストールすると
HTTPリクエストは私のために働きます

修正は#2302で行われます...承認されてマージされた場合は、できるだけ早くリリースしようとします

まったく同じ問題が発生しています。 マックOS

これは私をここ数時間困惑させました。 私は@ boddy33と同じindex.js持っていますが、index.jsが空の場合でも発生します。 これが私のfirebase-debug.logです:

[debug] [2020-05-28T19:54:42.206Z] [runtime-status] [27226] Checked functions.config() {"config":{}} 
[debug] [2020-05-28T19:54:42.206Z] [runtime-status] [27226] Error in handleMessage: {"frb":{"cwd":"/Users/aprilpolubiec/Documents/my-project/functions","projectId":"my-project","triggerId":"","emulators":{},"socketPath":"/var/folders/sh/fsnv9b8n29713r9d3kj_7w4c0000gn/T/fire_emu_27226.sock"},"opts":{"nodeBinary":"/Users/aprilpolubiec/.nvm/versions/node/v13.7.0/bin/node"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
    at /Users/aprilpolubiec/.nvm/versions/node/v13.7.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:457:19
    at Generator.next (<anonymous>)
    at fulfilled (/Users/aprilpolubiec/.nvm/versions/node/v13.7.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) 
[warn] ⚠  functions: Cannot set property config of #<Object> which has only a getter
[warn] ⚠  Your function was killed because it raised an unhandled error.

好奇心旺盛な承認を待っています

修正はfirebase-toolsバージョン8.4.1でリリースされました

ありがとう...ジャストインタイム

検証済み。 ありがとうございました。

こんにちは
約2日前に関数をデプロイしていましたが、昨日からデプロイできなかったため、すべて問題なく動作しました。 私はかなり古いパッケージを持っていました:

    "firebase": "^5.9.2",
    "firebase-admin": "~8.9.0",
    "firebase-functions": "^3.3.0",
    "firebase-tools": "^4.0.0",

そして私は次のものを得ていました:
image

しかし、ローカルで関数を実行することができました(--serve)。

今日、すべての依存関係を新しいバージョンに更新しました。理論的には修正プログラムが含まれているはずですが、残念ながら、この問題と同じように、新しいバグが発生しています。

    "firebase": "^7.14.5",
    "firebase-admin": "~8.10.0",
    "firebase-functions": "^3.6.2",
    "firebase-tools": "^8.4.1",
[2020-05-29T09:30:46.002Z] [runtime-status] [42525] Error in handleMessage: {"frb":{"cwd":"/Users/jakub.jodelka/xxxProject/backend","projectId":"xxxProject","triggerId":"","emulators":{},"socketPath":"/var/folders/nj/4g6vwdm90bl4tmktf8hpn__00000gp/T/fire_emu_42525.sock"},"opts":{"nodeBinary":"/usr/local/bin/firebase"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
    at /Users/jakub.jodelka/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:455:19
    at Generator.next (<anonymous>)
    at fulfilled (/Users/jakub.jodelka/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) 
⚠  functions: Cannot set property config of #<Object> which has only a getter
⚠  Your function was killed because it raised an unhandled error.

関数をデプロイすることはできませんが、同じ問題のためにローカルで実行することさえできません。

修正はfirebase-toolsバージョン8.4.1でリリースされました

最新バージョンを使用している場合、関数は正しくデプロイされますか?

@samtstern ^
この問題を解決する必要があるかどうかわからない。

@jakubjodelka node_modulesフォルダーをクリアして、 npm install再度実行してみてください。 その後もこれが発生し続け、 firebase --version 8.4.1されている場合

ありがとう。 今私のために働いています。

[2020-05-29T14:38:16.042Z] > 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"]
[2020-05-29T14:38:16.043Z] > authorizing via signed-in user
[2020-05-29T14:38:16.044Z] [iam] checking project bryn-todoapp-27e80 for permissions ["firebase.projects.get"]
[2020-05-29T14:38:16.047Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/bryn-todoapp-27e80:testIamPermissions
 {"permissions":["firebase.projects.get"]}
[2020-05-29T14:38:16.314Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Fri, 29 May 2020 14:38:16 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=117","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-05-29T14:38:16.316Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/bryn-todoapp-27e80  

[2020-05-29T14:38:16.590Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Fri, 29 May 2020 14:38:16 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}

=== Serving from 'C:\Users\Bryn\Desktop\bryn-todoapp'...

+  functions: Using node<strong i="5">@10</strong> from host. {"metadata":{"emulator":{"name":"functions"},"message":"Using node<strong i="6">@10</strong> from host."}}
i  functions: Watching "C:\Users\Bryn\Desktop\bryn-todoapp\functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\" for Cloud Functions..."}}
[2020-05-29T14:38:18.632Z] [worker-pool] addWorker(~diagnostic~) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(~diagnostic~)"}}
[2020-05-29T14:38:18.638Z] [worker-pool] Adding worker with key ~diagnostic~, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key ~diagnostic~, total=1"}}     
[2020-05-29T14:38:18.638Z] [worker-pool] submitWork(triggerId=) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=)"}}
[2020-05-29T14:38:18.639Z] [worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: Assigning socketPath: \\?\pipe\C:\Users\Bryn\Desktop\bryn-todoapp\functions\14372 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: Assigning socketPath: \\\\?\\pipe\\C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\\14372"}}
[2020-05-29T14:38:18.640Z] [worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: 
BUSY"}}
[2020-05-29T14:38:18.955Z] [runtime-status] [14372] Functions runtime initialized. {"cwd":"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions","node_version":"10.10.0"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Functions runtime initialized. {\"cwd\":\"C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\",\"node_version\":\"10.10.0\"}"}}
[2020-05-29T14:38:18.957Z] [runtime-status] [14372] Disabled runtime features: undefined {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Disabled runtime features: undefined"}}
[2020-05-29T14:38:18.960Z] [runtime-status] [14372] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.12.1","resolution":"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\\node_modules\\firebase-admin\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"8.12.1\",\"resolution\":\"C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\\\\node_modules\\\\firebase-admin\\\\lib\\\\index.js\"}"}}
[2020-05-29T14:38:18.961Z] [runtime-status] [14372] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.2","resolution":"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\\node_modules\\firebase-functions\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.6.2\",\"resolution\":\"C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\\\\node_modules\\\\firebase-functions\\\\lib\\\\index.js\"}"}}
!  functions: Your GOOGLE_APPLICATION_CREDENTIALS environment variable points to /home/user/Downloads/[bryn-todoapp-27e80-firebase-adminsdk-gp1c1-8bc2ce2561].json. Non-emulated services will access production using these credentials. Be careful! {"metadata":{"emulator":{"name":"functions"},"message":"Your GOOGLE_APPLICATION_CREDENTIALS environment variable points to /home/user/Downloads/[bryn-todoapp-27e80-firebase-adminsdk-gp1c1-8bc2ce2561].json. Non-emulated services will access production using these credentials. Be careful!"}}
[2020-05-29T14:38:18.974Z] [runtime-status] [14372] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Outgoing network have been stubbed. [{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"net\",\"status\":\"mocked\"}]"}}
[2020-05-29T14:38:19.003Z] [runtime-status] [14372] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Checked functions.config() {\"config\":{}}"}}
[2020-05-29T14:38:19.009Z] [runtime-status] [14372] Error in handleMessage: {"frb":{"cwd":"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions","projectId":"bryn-todoapp-27e80","triggerId":"","emulators":{},"socketPath":"\\\\?\\pipe\\C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\\14372"},"opts":{"nodeBinary":"C:\\Program Files\\nodejs\\node.exe"}} => TypeError: Cannot set property config of #<Object> which has 
only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
    at C:\Users\Bryn\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:455:19
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\Bryn\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:5:58)
    at process._tickCallback (internal/process/next_tick.js:68:7) {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Error in handleMessage: {\"frb\":{\"cwd\":\"C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\",\"projectId\":\"bryn-todoapp-27e80\",\"triggerId\":\"\",\"emulators\":{},\"socketPath\":\"\\\\\\\\?\\\\pipe\\\\C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\\\\14372\"},\"opts\":{\"nodeBinary\":\"C:\\\\Program Files\\\\nodejs\\\\node.exe\"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter\n    at C:\\Users\\Bryn\\AppData\\Roaming\\npm\\node_modules\\firebase-tools\\lib\\emulator\\functionsEmulatorRuntime.js:455:19\n    at Generator.next (<anonymous>)\n   
 at fulfilled (C:\\Users\\Bryn\\AppData\\Roaming\\npm\\node_modules\\firebase-tools\\lib\\emulator\\functionsEmulatorRuntime.js:5:58)\n    at process._tickCallback (internal/process/next_tick.js:68:7)"}}     
!  functions: Cannot set property config of #<Object> which has only a getter {"metadata":{"emulator":{"name":"functions"},"message":"Cannot set property config of #<Object> which has only a getter"}}        
!  Your function was killed because it raised an unhandled error. {"metadata":{"emulator":{"name":"functions"},"message":"Your function was killed because it raised an unhandled error."}}
[2020-05-29T14:38:19.019Z] [worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: exited {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: exited"}}
[2020-05-29T14:38:19.029Z] [worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: FINISHED {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: FINISHED"}}  `

私はまだそれ

image

@COFFEEEADDICT firebase --version8.4.1示していることを確認します

こんにちは、みんな、

firebase-functionsパッケージ(3.6.2)を更新した後、このエラーが発生しました。

私の場合、解決策は/node_modulesを削除し、 firebase-functionsを以前のバージョン( npm install --save [email protected] )にダウングレードすることfirebase-functions

こんにちはみんな、

私がインストールしたバージョンを最初に確認したのは8.1.1でした
呼び出してfirebase-toolsを更新してください

sudo npm i -g firebase-tools

これにより、最新バージョン8.4.1がインストールされます
そしてそれは私の問題を修正しました。
実際、私は最新のFirebase機能と管理者をインストールしました
"firebase-admin": "8.12.1"、
"firebase-functions": "3.6.1"、

問題が修正されたことを願っています。

作業ありがとう@iamsrujal

私はまだ問題を解決していませんか?

システム
Mac OS Catalina:10.15.4
ノード:v10.21.0
Java:openjdkバージョン "14.0.1" 2020-04-14

パッケージバージョン:
"firebase-admin": "^ 8.12.1"、
"firebase-functions": "^ 3.7.0"、
[email protected]

私が実行したコマンド:
firebaseエミュレーター:start-- only関数

コンソール出力:
iエミュレーターの起動:["関数"]
✔機能:ホストからnode @ 10を使用し
✔機能:エミュレータはhttp:// localhost :5001で開始されました
i関数:クラウド関数の「/ Users / chamika / Projects / Bitsmedia / Muslim-Pro-Firebase / functions」を監視しています...
⚠TypeError:#のプロパティ設定を設定できませんゲッターしかない
InitializeFunctionsConfigHelper(/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:328:15)
/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:448:13にあります
Generator.nextで(
/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:7:71にあります
新しい約束で(
__awaiter(/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:3:12)
メイン(/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:421:12)
オブジェクトで。(/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:511:5)
Module._compileで(internal / modules / cjs / loader.js:778:30)
Object.Module._extensions..js(internal / modules / cjs / loader.js:789:10)で
⚠未処理のエラーが発生したため、関数が強制終了されました。

私はこれと同じ問題を抱えており、firebase-toolsを更新しても消えません。 エミュレータを実行しようとすると失敗します。 firebase-debug.logには、次のように表示されます。

[debug] [2020-06-23T18:50:31.331Z] [runtime-status] [54019] Error in handleMessage: {"frb":{"cwd":"/Users/shaimo-mbp/dev/javascript/CryptoTracker/functions","projectId":"cryptotracker-fa488","triggerId":"","ports":{"firestore":8080},"socketPath":"/var/folders/83/c3hy2yfx53g6_f3bvwcslqcc0000gn/T/fire_emu_54019.sock"},"opts":{"nodeBinary":"/Users/shaimo-mbp/.nvm/versions/node/v10.18.1/bin/node"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
    at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:514:19
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[warn] ⚠  functions:
[warn] ⚠  Your function was killed because it raised an unhandled error.

どうすれば修正できますか? 完全にここで立ち往生...

まだこの問題が発生している場合:コピーできる方法で、新しく初期化されたプロジェクトでこの問題を再現できる場合は、新しい問題を提出してください。試してみます。

それが誰かを助ける場合:私はツールをアップグレードするために明示的なバージョンを使用しなければならなかった、そしてそれから問題は消えた:
sudo npm i -g [email protected]

システム
Mac OS Catalina:10.15.4
ノード:v10.21.0
Java:openjdkバージョン "14.0.1" 2020-04-14

2020年9月7日の時点で、 "firebase-admin": "^8.10.0",を使用している間、この問題は引き続き存在します。
"firebase-admin": "^8.12.1",に更新し、 `" firebase-tools ":" 8.4.1 "があることを再確認する必要がありました。

JohnGeorgiadisと同じセットアップ。 同じ問題...

functions: Cannot set property config of #<Object> which has only a getter ⚠ Your function was killed because it raised an unhandled error.

さまざまな依存関係のさまざまなバージョンを試して、解決しませんでした。

たぶんこれは誰かに役立つでしょう:私のLinuxはコンソールに「firebase」と入力するたびに「/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js」を使用していたので、7.12を使用していました。パッケージの0バージョン。 シンボリックリンクを変更しましたが、8.6.0バージョンを使用していると確信しています。

user<strong i="6">@machine</strong>: which firebase
/usr/local/bin/firebase
user<strong i="7">@machine</strong>: cd /usr/local/bin
user<strong i="8">@machine</strong>: sudo rm firebase
user<strong i="9">@machine</strong>: sudo ln -s /usr/lib/node_modules/firebase-tools/lib/bin/firebase.js firebase
user<strong i="10">@machine</strong>: firebase --version
8.6.0

_local_という言葉が鍵です

グローバルインストールでは、firebase-toolsが「/ usr / local / lib / node_modules」にインストールされます。 ただし、OPで強調表示されている問題は、別のパス '/ usr / lib / node_modules / firebase-tools /'を指しています。
最初のパスには最新バージョンのfirebase-tools8.6.0がありましたが、2番目のパスにはバージョン7.0.2がありました。

Firebase-Vは7.0.2を返しました

ここに関連するコメントがあります(ここでの議論から:https://stackoverflow.com/q/5926672/7461599)

installing without -g option will install a module to you working directory e.g. if you make a directory say ~/Desktop/tmp then cd ~/Desktop/tmp then do npm install appium then do ls you will see node_modules package-lock.json because you have installed a node module appium to your working directory... super confusing because -g should essentially be the default but is not.

npm uninstall firebase-toolsを実行してから、最新バージョンが-gインストールされていることを確認しました。 これで、 firebase -V最新バージョンの正しいパスを指し、firebaseエミュレーターがスムーズに実行されます。

それが役立つ場合は、グローバルnpm [email protected]とグローバルヤーン[email protected]間に競合がありました。 グローバルnpmバージョンを削除すると、 firebase -Vから7.0.0が返される問題が修正されました

中に使用されたノードバージョンが異なるため、上記のエラーが発生していました

  1. プロジェクトの初期化(firebase init)=>ノードバージョン=> v8.xx
  2. 実行中のプロジェクト(firebaseエミュレーター:開始)=>ノードバージョン=> v12.xx

同じノードバージョンを作成して問題を解決しました

たぶんこれは誰かに役立つでしょう:私のLinuxはコンソールに「firebase」と入力するたびに「/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js」を使用していたので、7.12を使用していました。パッケージの0バージョン。 シンボリックリンクを変更しましたが、8.6.0バージョンを使用していると確信しています。

user<strong i="7">@machine</strong>: which firebase
/usr/local/bin/firebase
user<strong i="8">@machine</strong>: cd /usr/local/bin
user<strong i="9">@machine</strong>: sudo rm firebase
user<strong i="10">@machine</strong>: sudo ln -s /usr/lib/node_modules/firebase-tools/lib/bin/firebase.js firebase
user<strong i="11">@machine</strong>: firebase --version
8.6.0

_local_という言葉が鍵です

sudo rmfirebaseを元に戻すにはどうすればよいですか

たぶんこれは誰かに役立つでしょう:私のLinuxはコンソールに「firebase」と入力するたびに「/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js」を使用していたので、7.12を使用していました。パッケージの0バージョン。 シンボリックリンクを変更しましたが、8.6.0バージョンを使用していると確信しています。

user<strong i="8">@machine</strong>: which firebase
/usr/local/bin/firebase
user<strong i="9">@machine</strong>: cd /usr/local/bin
user<strong i="10">@machine</strong>: sudo rm firebase
user<strong i="11">@machine</strong>: sudo ln -s /usr/lib/node_modules/firebase-tools/lib/bin/firebase.js firebase
user<strong i="12">@machine</strong>: firebase --version
8.6.0

_local_という言葉が鍵です

sudo rmfirebaseを元に戻すにはどうすればよいですか

あなたは(簡単に)できません。 私は似たようなバイナリを見つけて同じパスに配置しようとします

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