【问题标题】:Firebase init "Node.js 8 has been deprecated." [duplicate]Firebase 初始化“Node.js 8 已被弃用。” [复制]
【发布时间】:2020-10-10 00:00:20
【问题描述】:

当我运行 firebase init 启动新项目时,会自动创建 package.json 文件(如下),当我转到 firebase 仪表板时,它会抛出此警告“

Starting NaN, NaN, we'll no longer support new deploys or updates of Node.js 8 functions.
Starting NaN, NaN, we'll no longer support executions of existing Node.js 8 functions.

你如何初始化和指定版本?或者有什么解决方法?

{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "eslint .",
    "serve": "firebase emulators:start --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "8"
  },
  "dependencies": {
    "firebase-admin": "^8.10.0",
    "firebase-functions": "^3.6.1"
  },
  "devDependencies": {
    "eslint": "^5.12.0",
    "eslint-plugin-promise": "^4.0.1",
    "firebase-functions-test": "^0.2.0"
  },
  "private": true
}

**版主我没有遇到类似的问题,因为他们的措辞方式没有出现在谷歌中。此帖子每天的流量证明它对社区有帮助**

【问题讨论】:

标签: firebase google-cloud-functions package.json firebase-cli


【解决方案1】:

你必须改变你的package.json

你在哪里:

"engines": {
    "node": "8"
  }

改为:

"engines": {
    "node": "10"
  },

firebase documentation所述。

【讨论】:

  • 转到谷歌云功能>点击编辑>将下拉菜单更改为节点10>将"engines": { "node": "8" }更改为"engines": { "node": "10" }点击保存
猜你喜欢
  • 1970-01-01
  • 2021-06-21
  • 2019-08-06
  • 2020-12-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-12
相关资源
最近更新 更多