在 heroku 上部署节点项目时出错

Error while deploying node project on heroku

我成功部署了项目,然后在 package.json 和其他文件中进行了一些更改。

现在报错了。

package.json文件中


    "test": "echo \"Error: no test specified\" && exit 1",

    "start": "node server.js",

    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"

  },

出现以下错误

remote: -----> Build
remote:        Running heroku-postbuild
remote:        
remote:        > hotel-booking-guide@1.0.0 heroku-postbuild
remote:        > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
remote:
remote:        
remote:        up to date, audited 1973 packages in 4s
remote:
remote:        162 packages are looking for funding
remote:          run `npm fund` for details
remote:
remote:        27 vulnerabilities (16 moderate, 9 high, 2 critical)
remote:
remote:        To address all issues (including breaking changes), run:
remote:          npm audit fix --force
remote:
remote:        Run `npm audit` for details.
remote:        
remote:        > hotel_booking@0.1.0 build
remote:        > react-scripts build
remote:
remote:   sh: 1: react-scripts: Permission denied
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: 

似乎 'npm run build' 出错了。

您可以尝试使用 git push -f heroku master 强制推送您的更改。您可以阅读更多 here.