我有一个全新安装的firebase工具(按照本教程),我正在尝试上传我的第一个firebase功能.我在hello-world示例中遇到了这个问题,它们在运行firebase init时初始化(在init期间唯一设置函数CLI功能)
如果我取代$RESOURCE_DIR在firebase.json我的文件夹功能,它的工作原理,但当然这是不好的做法,我想找到一个妥善$RESOURCE_DIR的作品更换.
PS D:\workspace\firebase-functions> firebase deploy
    === Deploying to 'newagent-5221d'...
i  deploying functions
Running command: npm --prefix $RESOURCE_DIR run lint
npm ERR! path D:\workspace\firebase-functions\$RESOURCE_DIR\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\workspace\firebase-functions\$RESOURCE_DIR\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of …我正在使用http云函数来侦听请求,然后返回一条简单的消息.
我正在使用以下方式在本地开发云功能:
firebase serve --only functions
我使用设置了一些自定义环境变量
firebase functions:config:set
在部署项目时,使用以下代码访问自定义配置变量可以正常工作
 functions.config()
但在本地开发时它不起作用.当命中触发该函数时:http:// localhost:5002/my-project-name/us-central1/functionName我无法访问自定义配置变量.当在本地使用functions.config()时,我可以看到默认配置,而不是我的自定义配置变量
在本地工作时是否有替代解决方案或环境变量的最佳实践?
尝试使用PayPal-node-SDK向Paypal的API发出请求
exports.requestPayment = functions.https.onRequest((req, res) => {
    return new Promise(function (fullfilled, rejected) {
        paypal.payment.create(create_payment_json, {}, function (error, payment) {
            if (error) {
                rejected(error);
            } else {
                console.log("Create Payment Response");
                console.log(payment);
                res.status(200).send(JSON.stringify({
                    paymentID: payment.id
                })).end();
                fullfilled(payment);
            }
        });
     });
});
但我经常收到一个错误:
Error: getaddrinfo ENOTFOUND api.sandbox.paypal.com api.sandbox.paypal.com:443
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
我试过的事情:
ENOTFOUNDcors(req,res, ()=>{...})https://主持人问题是什么?
我正在尝试设置firebase函数,但运行firebase init后出错.
错误:HTTP错误:401,请求具有无效的身份验证凭据.预期的OAuth 2访问令牌,登录cookie或其他有效的身份验证凭据.请参阅https://developers.google.com/identity/sign-in/web/devconsole-project.
对不起,如果这是一个天真的问题,但我看了谷歌的工作人员的一堆谈话,仍然不明白为什么我会使用AE而不是CF?
如果我理解正确的话,这两种服务的整体概念就是构建"微服务架构".
虽然,AE必须包装到自己的服务器中.基本上它在与CF相同的功能之上利用了许多复杂性.那么,我何时应该使用它而不是CF?
google-app-engine google-cloud-platform google-cloud-functions serverless
我正在使用Firebase开发Server.
我在Youtube上复制了Google Developer's Video .
它运行良好,但在日志中有一个错误:
函数返回undefined,预期Promise或value
它说函数返回了undefined,但是我function返回一个promise`set``
我怎么解决这个问题?
function sanitize(s) {
    var sanitizedText = s;
    console.log('sanitize params: ', sanitizedText);
    sanitizedText = sanitizedText.replace(/\bstupid\b/ig, "wonderful");
    return sanitizedText;
}
exports.sanitizePost = functions.database
    .ref('/posts/{pushId}')
    .onWrite(event => {
        const post = event.data.val();
        if (post.sanitized) return;
        console.log('Sanitizing new post', event.params.pushId);
        console.log(post);
        post.sanitized = true;
        post.title = sanitize(post.title);
        post.body = sanitize(post.body);
        return event.data.ref.set(post); 
    })
我是Firebase,Nodejs的初学者.
javascript node.js firebase firebase-realtime-database google-cloud-functions
在我运行时:
firebase deploy
我在命令行上收到此错误:
HTTP 错误:400,未找到项目“381106441303”的结算帐户。必须为激活服务“cloudbuild.googleapis.com,containerregistry.googleapis.com”启用计费才能继续。
请告诉我如何解决这个问题!
运行firebase deploy --only functions在创建新函数之前删除现有函数.是否可以将此行为修改为create if not exist, update if exists, no actions if functions not being deployed?
我想知道是否可以使用firebase云功能向非谷歌服务器发送一个帖子请求(我可以找到我需要在火焰计划上与非谷歌服务器进行交互)
基本上我想在每次将值添加到数据库时POST到运行在arduino上的外部服务器.
我查看了文档并找到了云函数响应HTTP post请求(HTTP云函数)的示例,但似乎无法找到任何发布到外部服务器的示例.这可能吗?
无法部署 Firebase 功能。我有两个项目别名,它对于第一个项目(dev)工作正常,但对于第二个项目(prod)则不然。
每当我写作时,firebase deploy --only functions我都会收到以下消息
i deploying functions
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
+  functions: required API cloudbuild.googleapis.com is enabled
+  artifactregistry: required API artifactregistry.googleapis.com is enabled
+  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: preparing codebase default for deployment
!  functions: package.json indicates an outdated version of firebase-functions. Please upgrade 
using npm install --save firebase-functions@latest …firebase google-cloud-platform google-cloud-functions firebase-cli
firebase ×9
firebase-cli ×3
node.js ×3
javascript ×2
dns ×1
function ×1
npm ×1
paypal ×1
serverless ×1