'I'm not able to deploy my MERN App on Heroku

I'm trying to connect my GitHub account and deploy it on Heroku using GitHub Connect.

I'm getting this error which I'm not able to solve.

sh: 1: react-scripts: Permission denied
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

Here is my GitHub repository link - https://github.com/aquib12377/thehealthykrunch



Solution 1:[1]

In your package.json file. You should have a build command. Heroku uses that to build your project.

So in build stage heroku first installs all your node modules and later on it runs npm run build. Then finally for deploying npm start command is run

Solution 2:[2]

Run command on terminal to check logs and add npm version in your pacage.json

 heroku logs --app your_app_name

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman
Solution 2 Mrunal Tupe