答案 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)
答案 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"
}