2017-10-19 6 views
0

firebaseに関数をデプロイしようとしているときにこのエラーが発生します。私はこのチュートリアルを使いました。 https://firebase.google.com/docs/functions/get-started enter image description hereFirebase機能のデプロイエラーがモジュールfirebase-adminを見つけることができません

私のpackage.jsonはこれです。

{ 
    "name": "functions", 
    "description": "Cloud Functions for Firebase", 
    "dependencies": { 
    "firebase-admin": "^5.4.2", 
    "firebase-functions": "^0.7.1" 
    }, 
    "private": true 
} 

そして、私のindex.jsいただきましたコードで間違ったあなたは私を伝えることができ、この

const functions = require('firebase-functions'); 
// The Firebase Admin SDK to access the Firebase Realtime Database. 
const admin = require('firebase-admin'); 
admin.initializeApp(functions.config().firebase); 

// // Create and Deploy Your First Cloud Functions 
// // https://firebase.google.com/docs/functions/write-firebase-functions 
// 
exports.helloWorld = functions.https.onRequest((request, response) => { 
response.send("Hello from Firebase!"); 
}); 
// Take the text parameter passed to this HTTP endpoint and insert it into the 
// Realtime Database under the path /messages/:pushId/original 
exports.addMessage = functions.https.onRequest((req, res) => { 
    // Grab the text parameter. 
    const original = req.query.text; 
    // Push the new message into the Realtime Database using the Firebase Admin SDK. 
    admin.database().ref('/messages').push({original: original}).then(snapshot => { 
    // Redirect with 303 SEE OTHER to the URL of the pushed object in the Firebase console. 
    res.redirect(303, snapshot.ref); 
    }); 
}); 

のですか?前もって感謝します。

答えて

1

あなたのコードはファイヤーベースのクラウド機能の問題です。ここ 同じ問題:

issue

FWD:

私はすでに解決しました。これは火災の問題です。

昨日からfirebaseクラウドサービスに支障があります。

see this image

問題の説明:https://status.firebase.google.com/incident/Functions/17024

問題の解決策:

実行機能リポジトリ内の以下のコマンドを実行します。

npm install --save-exact [email protected] npm install --save-exact [email protected] 

その後、再び機能を導入してみてください。

firebase deploy --only functions 

私は、これは、それが働いた:)

+0

うわーに役立ちます願っています。あなたは人生保護人です。どうもありがとう。 –

関連する問題