Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.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
Node.js firebase函数模拟器版本冲突_Node.js_Firebase_Google Cloud Functions_Firebase Cli - Fatal编程技术网

Node.js firebase函数模拟器版本冲突

Node.js firebase函数模拟器版本冲突,node.js,firebase,google-cloud-functions,firebase-cli,Node.js,Firebase,Google Cloud Functions,Firebase Cli,我正在开发macOS High Sierra,版本10.13.5 当我尝试使用节点v6.11.5在本地运行函数时,会出现以下错误: ⚠ 功能:无法启动模拟器。请使用节点版本v6.9.1,您有v6.11.5 然后,当我使用nvm切换到v6.9.1版本时 nvm use 6.9.1 rm -rf node_modules npm install npm uninstall firebase-tools --global npm install firebase-tools --global fun

我正在开发macOS High Sierra,版本10.13.5

当我尝试使用节点v6.11.5在本地运行函数时,会出现以下错误:

⚠ 功能:无法启动模拟器。请使用节点版本v6.9.1,您有v6.11.5

然后,当我使用nvm切换到v6.9.1版本时

nvm use 6.9.1
rm -rf node_modules
npm install
npm uninstall firebase-tools --global
npm install firebase-tools --global
functions stop
npm uninstall -g @google-cloud/functions-emulator
npm install -g @google-cloud/functions-emulator
firebase login
firebase serve --only functions --debug
然后出现以下错误:

运行模拟器需要Node.js v6.11.5或更高版本

⚠ 功能:来自模拟器的错误。错误:模拟器崩溃!检查日志文件

以下是完整日志:

[2018-06-30T15:43:38.960Z] ----------------------------------------------------------------------
[2018-06-30T15:43:38.964Z] Command:       /Users/duyanh/.nvm/versions/node/v6.9.1/bin/node /Users/duyanh/.nvm/versions/node/v6.9.1/bin/firebase serve --only functions --debug
[2018-06-30T15:43:38.965Z] CLI Version:   3.19.1
[2018-06-30T15:43:38.965Z] Platform:      darwin
[2018-06-30T15:43:38.965Z] Node Version:  v6.9.1
[2018-06-30T15:43:38.966Z] Time:          Sat Jun 30 2018 10:43:38 GMT-0500 (CDT)
[2018-06-30T15:43:38.966Z] ----------------------------------------------------------------------

[2018-06-30T15:43:38.978Z] > 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"]
[2018-06-30T15:43:38.979Z] > authorizing via signed-in user
[2018-06-30T15:43:38.981Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/dewey-nguyen

 Sat Jun 30 2018 10:43:38 GMT-0500 (CDT)
[2018-06-30T15:43:39.348Z] <<< HTTP RESPONSE 200 server=nginx, date=Sat, 30 Jun 2018 15:43:39 GMT, content-type=application/json; charset=utf-8, content-length=111, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-06-30T15:43:39.350Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/dewey-nguyen/tokens

 Sat Jun 30 2018 10:43:39 GMT-0500 (CDT)
[2018-06-30T15:43:39.953Z] <<< HTTP RESPONSE 200 server=nginx, date=Sat, 30 Jun 2018 15:43:39 GMT, content-type=application/json; charset=utf-8, content-length=260, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-06-30T15:43:39.955Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/dewey-nguyen

 Sat Jun 30 2018 10:43:39 GMT-0500 (CDT)
[2018-06-30T15:43:40.183Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sat, 30 Jun 2018 15:43:40 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="43,42,41,39,35", accept-ranges=none, connection=close

=== Serving from '/Users/duyanh/workspace/dewey-nguyen'...

i  functions: Preparing to emulate functions.
[2018-06-30T15:43:40.736Z] Fetching environment
[2018-06-30T15:43:40.739Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/580895528558:getServerAppConfig

 Sat Jun 30 2018 10:43:40 GMT-0500 (CDT)
[2018-06-30T15:43:41.167Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sat, 30 Jun 2018 15:43:41 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="43,42,41,39,35", accept-ranges=none, connection=close
[2018-06-30T15:43:41.168Z] Starting @google-cloud/functions-emulator
Node.js v6.11.5 or greater is required to run the Emulator!
⚠  functions: Error from emulator. Error: Emulator crashed! Check the log file...
[2018-06-30T15:43:41.256Z] Error: Emulator crashed! Check the log file...
    at ChildProcess.child.on (/Users/duyanh/.nvm/versions/node/v6.9.1/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/src/cli/controller.js:650:24)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

你能给我一些线索,告诉我发生了什么,以及可能的解决方法吗?

嗨,你有什么解决办法吗,我面临着同样的问题吗?不,我仍然在同一个系统上不时地面对这个问题。但当我在另一个系统上结账时,我不会面对这个问题。
{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    ...
  },
  "dependencies": {
    "@google-cloud/vision": "^0.20.0",
    "actions-on-google": "^2.2.0",
    "bluebird": "^3.5.1",
    "colors": "^1.3.0",
    "dialogflow-fulfillment": "^0.4.1",
    "firebase-admin": "~5.4.0",
    "firebase-functions": "^1.1.0",
    "googleapis": "^32.0.0",
    "lodash": "^4.17.10",
    "moment": "^2.22.2",
    "winston": "^3.0.0"
  },
  "private": true,
  "devDependencies": {
    "@babel/cli": "^7.0.0-beta.51",
    "@babel/core": "^7.0.0-beta.51",
    "@babel/preset-env": "^7.0.0-beta.51",
    "firebase-admin": "^5.4.3"
  }
}