android 缺少脚本:构建- firebase部署

hgb9j2n6  于 2023-06-20  发布在  Android
关注(0)|答案(3)|浏览(107)

当我部署我的firebase函数项目时,这个错误出现“missing script:build”,我试图修复它,但失败了。请帮帮我
这是错误截图

vpfxa7rd

vpfxa7rd1#

从firebase.json中删除“predeploy”

{
  "functions": {
    "predeploy": "npm --prefix functions run build",
    "source": "functions"
  }
}
mutmk8jj

mutmk8jj2#

对我来说,当我添加这个时,它起作用了:

"build": "",
{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "eslint .",
    "build": "",
    "serve": "firebase serve --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "12"
  },
  "main": "index.js",
  "dependencies": {
    "cookie-parser": "^1.4.5",
    "cors": "^2.8.5",
    "dotenv": "^8.2.0",
    "firebase": "^7.22.0",
    "firebase-admin": "^9.4.1",
    "firebase-functions": "^3.11.0"
  },
  "devDependencies": {
    "eslint": "^5.12.0",
    "eslint-plugin-promise": "^4.0.1",
    "firebase-functions-test": "^0.2.0"
  },
  "private": true
}

wvt8vs2t

wvt8vs2t3#

我也犯了同样的错误。我对脚本部分进行了如下修改。这解决了问题,并部署了功能。

"scripts": {
    "build": "",
    "serve": "firebase serve --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  }

相关问题