我刚刚开始关注'入门'教程。我的index.js文件包含代码:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().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 it into the Realtime Database then send a response
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);
});
});
[debug]错误:ENOTEMPTY:目录不为空,rmdir' C:\ Users \ sai \ AppData \ Local \ Temp \ fbfn_1892YPzPCgcquJf3 \ node_modules' 在错误(本机) at Object.fs.rmdirSync(fs.js:887:18) 在rmkidsSync(C:\ Users \ sai \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ node_modules \ rimraf \ rimraf.js:355:25) 在rmdirSync(C:\ Users \ sai \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ node_modules \ rimraf \ rimraf.js:333:7) 在rimrafSync(C:\ Users \ sai \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ node_modules \ rimraf \ rimraf.js:303:9) 在C:\ Users \ sai \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ node_modules \ rimraf \ rimraf.js:341:5 at Array.forEach(native) 在rmkidsSync(C:\ Users \ sai \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ node_modules \ rimraf \ rimraf.js:340:26) 在rmdirSync(C:\ Users \ sai \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ node_modules \ rimraf \ rimraf.js:333:7) 在Function.rimrafSync [as sync](C:\ Users \ sai \ AppData \ Roaming \ npm \ node_modules \ firebase-tools \ node_modules \ rimraf \ rimraf.js:303:9) [错误] [错误]错误:发生了意外错误。 [info]我 功能:用于上传[debug]>>>的打包功能(997 B) HTTP 请求获取 https://www.googleapis.com/storage/v1/b/staging.mingle-be3a8.appspot.com 2017年4月5日星期三10:15:00 GMT + 0530(印度标准时间)