推送被拒绝,无法编译Node.js应用。尝试了此网站上发布的许多不同内容

时间:2018-09-19 01:53:10

标签: javascript reactjs heroku

在尝试推送到heroku时,请继续接收以下错误。这实际上是从教师那里复制并粘贴的。我真的不知道还能尝试什么。有什么建议么? 这些是我为发布此问题而添加的额外细节,因为显然我需要写一本有关该帖子的细节的书

$input = $_POST['num'];
if($input){
    switch($input) {
        ....
    }
}

这是我的package.json

 remote: npm ERR! code ELIFECYCLE
    remote: npm ERR! errno 2
    remote: npm ERR! expensify@1.0.0 build:prod: `webpack -p --env production`
    remote: npm ERR! Exit status 2
    remote: npm ERR!
    remote: npm ERR! Failed at the expensify@1.0.0 build:prod script.
    remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    remote:
    remote: npm ERR! A complete log of this run can be found in:
    remote: npm ERR!     /tmp/npmcache.cjxoG/_logs/2018-09-19T01_45_36_828Z-debug.log
    remote: npm ERR! code ELIFECYCLE
    remote: npm ERR! errno 2
    remote: npm ERR! expensify@1.0.0 heroku-postbuild: `npm run build:prod`
    remote: npm ERR! Exit status 2
    remote: npm ERR!
    remote: npm ERR! Failed at the expensify@1.0.0 heroku-postbuild script.
    remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    remote:
    remote: npm ERR! A complete log of this run can be found in:
    remote: npm ERR!     /tmp/npmcache.cjxoG/_logs/2018-09-19T01_45_36_842Z-debug.log
    remote:
    remote: -----> Build failed
    remote:
    remote:        We're sorry this build is failing! You can troubleshoot common issues here:
    remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
    remote:
    remote:        If you're stuck, please submit a ticket so we can help:
    remote:        https://help.heroku.com/
    remote:
    remote:        Love,
    remote:        Heroku
    remote:
    remote:  !     Push rejected, failed to compile Node.js app.
    remote:
    remote:  !     Push failed
    remote: Verifying deploy...
    remote:
    remote: !       Push rejected to expensebudget.
    remote:
    To https://git.heroku.com/expensebudget.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/expensebudget.git'

2 个答案:

答案 0 :(得分:0)

尝试

"build:prod": "webpack -p --env.production"

代替

"build:prod": "webpack -p --env production"

答案 1 :(得分:0)

npm cache clean --force

然后删除node_modules文件夹

然后删除package-lock.json文件

npm install