简体   繁体   English

缺少脚本:build - firebase deploy

[英]missing script: build - firebase deploy

When I deployed my firebase function project, this error appeared "missing script:build" and I try to fix it but it fails.当我部署我的 firebase function 项目时,出现“缺少脚本:构建”的错误,我尝试修复它但失败了。 Please help me请帮我

This is error screenshot这是错误截图在此处输入图像描述

Remove the "predploy" from firebase.json从 firebase.json 中删除“预部署”

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

For me, it worked when I added this:对我来说,当我添加这个时它起作用了:

"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
}

配置截图

I was also facing the same error.我也面临同样的错误。 I modified the scripts section as follows.我修改了脚本部分如下。 This resolved the issue and function got deployed.这解决了问题并部署了功能。

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

just add => build:'' in your package.json只需在 package.json 中添加 => build:''

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM