缺少脚本:构建-Firebase部署

时间:2018-08-09 07:18:38

标签: javascript android node.js google-cloud-functions firebase-tools

当我部署Firebase函数项目时,此错误显示为“缺少脚本:生成”,我尝试对其进行修复,但失败。 请帮助我

  

这是错误屏幕截图   enter image description here

3 个答案:

答案 0 :(得分:4)

从firebase.json中删除“ predploy”

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

答案 1 :(得分:0)

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

//Create a div
var div = document.createElement('div');

//Give the div some style. IMPORTANT: notice the transition
div.style = 'width: 100px; height: 100px; background: black; position: absolute; top: 10px; left: 10px; transition: all 2s;';

//Append the div to the body
document.body.appendChild(div);

//Create a timeout for the div to move
setTimeout(function() {

  //Change the style.top to 50%, You can also do this in px
  div.style.top = '50%';
  
  //Change the style.top to 50%, You can also do this in px
  div.style.left = '50%';
  
  //Add the transform so it can be centered in the viewport
  div.style.transform = 'translate(-50%,-50%)';
  
  //Add the timeout below in milliseconds.
}, 1000)

config-screenshot

答案 2 :(得分:0)

我也遇到了同样的错误。我修改了脚本部分如下。这解决了问题并部署了功能。

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