Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
`firebase服务--仅功能”-错误:抱歉,没有项目ID,我们无法连接到Google云服务_Firebase_Google Cloud Functions - Fatal编程技术网

`firebase服务--仅功能”-错误:抱歉,没有项目ID,我们无法连接到Google云服务

`firebase服务--仅功能”-错误:抱歉,没有项目ID,我们无法连接到Google云服务,firebase,google-cloud-functions,Firebase,Google Cloud Functions,我有两个HTTP函数。部署到云计算时,它运行良好。但为了发展,当我试图在当地为他们提供服务时 firebase服务--仅限功能 我得到了这个错误 ERROR: Function load error: Code could not be loaded. ERROR: Does the file exists? Is there a syntax error in your code? ERROR: Detailed stack trace: /home/saiy2k/projects/ionic

我有两个HTTP函数。部署到云计算时,它运行良好。但为了发展,当我试图在当地为他们提供服务时

firebase服务--仅限功能

我得到了这个错误

ERROR: Function load error: Code could not be loaded.
ERROR: Does the file exists? Is there a syntax error in your code?
ERROR: Detailed stack trace: /home/saiy2k/projects/ionic/grcloud/functions/node_modules/@google-cloud/common/src/util.js:545
    throw util.missingProjectIdError;
    ^

Error: Sorry, we cannot connect to Google Cloud Services without a project ID. You may specify one with an environment variable named "GCLOUD_PROJECT". See https://googlecloudplatform.github.io/google-cloud-node/#//docs/guides/authentication for a detailed guide on creating an authenticated connection.
    at Object.<anonymous> (/home/saiy2k/projects/ionic/grcloud/functions/node_modules/@google-cloud/common/src/util.js:54:29)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/saiy2k/projects/ionic/grcloud/functions/node_modules/@google-cloud/common/src/service.js:30:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/saiy2k/projects/ionic/grcloud/functions/node_modules/@google-cloud/common/src/grpc-service.js:38:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

⚠  functions: Failed to emulate handlePayment
⚠  functions: Failed to emulate testHTTPListener
i  functions: No HTTPS functions emulated. Support for other function types are coming soon.

不管它值多少钱,这绝对不是一个好的解决方案,但它是有效的

在第545行的
/home/saiy2k/projects/ionic/grcloud/functions/node_modules/@google cloud/common/src/util.js中注释导致错误的
不会对我可以收集的模拟器造成不良影响


check function接收的所有对象在我的实例中都是未定义的或空的,因此,如果不检查堆栈中为什么会出现这种情况,我很高兴能够通过这种方法让我重回正轨

使用最新的Firebase CLI版本可以解决此问题。我应该删除这个帖子吗?
{
    "name": "functions",
    "description": "Cloud Functions for Firebase",
    "dependencies": {
        "@google-cloud/storage": "^0.4.0",
        "child-process-promise": "^2.2.0",
        "firebase-admin": "~4.2.1",
        "firebase-functions": "^0.5.9",
        "mkdirp": "^0.5.1",
        "mkdirp-promise": "^4.0.0",
        "moment": "^2.18.1",
        "request": "^2.81.0",
        "request-promise": "^4.2.1",
        "typescript": "^2.4.2"
    },
    "private": true,
    "devDependencies": {
        "ts-loader": "^2.3.2",
        "webpack-node-externals": "^1.6.0"
    }
}