firebase函数是否支持node 18版本作为package.json文件中的引擎参数。当我使用 Node 18 作为引擎参数时,我收到错误“错误:函数目录中的 package.json 有一个不受支持的引擎字段。有效选择是:{“node”:10|12|14|16}”。
我尝试在引擎参数字段中使用节点 18 作为
"engines": {
"node": "18"
},
Run Code Online (Sandbox Code Playgroud)
我的 package.json 看起来像这样:
{
"name": "functions",
"scripts": {
"build": "webpack --mode production",
"watch": "webpack --watch --mode development",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log",
"test": "jest",
"lint": "tslint --project tsconfig.json",
"fmt": "prettier --config '../.prettierrc' --write 'src/**/*.{tsx,ts}'"
},
"engines": {
"node": "18"
},
"main": "dist/index.js", …Run Code Online (Sandbox Code Playgroud) node.js package.json google-cloud-functions google-cloud-firestore react-typescript