2

Hi everyone I'm trying to deploy a React-node App on Heroku and this is the console log of heroku:

-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 14.x...
       Downloading and installing node 14.17.1...
       Using default npm version: 6.14.13
       
-----> Installing dependencies
       Installing node modules
       npm ERR! bindings not accessible from watchpack-chokidar2:fsevents
       
       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.5mYJI/_logs/2021-06-23T22_19_01_465Z-debug.log
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       Some possible problems:
       
       - Node version not specified in package.json
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed

And this is my repositorie: https://github.com/aadiegoaa96/reactporfolioDiego And the Heroku app link: https://reactporfoliodnbc.herokuapp.com/

Thanks for all the support.

1
  • 3
    I had similar error due to npm 7 package-lock.json unreadable by npm6 CI Commented Aug 26, 2021 at 13:28

3 Answers 3

5

I had similar issue. Deleting package-lock.json file solved the issue.

Sign up to request clarification or add additional context in comments.

Comments

1

I have solved this issue when i figured out that my local npm version wasn't fit with the npm version in Heroku. I needed to add the same npm version in my Heroku environment as my local version like this in package.json:

{
"engines":{
"node":"yournodeversion",
"npm":"yournpmversion"
}
}

Comments

0

Using the create-react-app buildpack for Heroku can solve this issue.

Currently, your react-app is treated as a regular node.js application as the node.js buildpack is used which is automatically inferred due to the presence of package.json in the root.

CRA Buildpack : https://elements.heroku.com/buildpacks/nhutphuongit/create-react-app-buildpack

(Similar Q) - React Application on Heroku

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.