当我运行git push heroku master
时,我得到这个错误:
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/exampleapp-54011.git'
我想要推送的所有文件都在公共文件夹中,这是我的app.js
:
const express = require("express");
const path = require("path");
const PORT = process.env.PORT || 3000;
const app = express();
app.use(express.static(path.join(__dirname, "public")));
app.listen( PORT, ()=> console.log(`server started at port ${PORT}`) );
您需要先做git pull
,然后再做git push
。
https://stackoverflow.com/a/9794467/16471757