2

I've been trying to deploy my mern app to Heroku but my build fails every time. I googled a lot to fix it but nothing worked so far. I understand my question is vague but I don't know where to start to fix the issue.

Here are my build log on Heroku and its github repo.

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false

-----> Installing binaries
       engines.node (package.json):  14.x
       engines.npm (package.json):   unspecified (use default)

       Resolving node version 14.x...
       Downloading and installing node 14.4.0...
       Using default npm version: 6.14.5

-----> Installing dependencies
       Prebuild detected (node_modules already exists)
       Rebuilding any native modules
       npm ERR! code ENOENT
       npm ERR! syscall chmod
       npm ERR! path /tmp/build_c713e498cf2a486755bda4d60090cf23/node_modules/semver/bin/semver
       npm ERR! errno -2
       npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/build_c713e498cf2a486755bda4d60090cf23/node_modules/semver/bin/semver'
       npm ERR! enoent This is related to npm not being able to find a file.
       npm ERR! enoent 

       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.Ts0zT/_logs/2020-06-15T21_07_24_073Z-debug.log
-----> Build failed

https://github.com/cornman00/coronavirus

Please give me any idea to fix this.

Will
  • 151
  • 1
  • 1
  • 8
  • 1
    Untrack your `node_modules/` and let Heroku install its own dependencies. – Chris Jun 15 '20 at 22:18
  • Does this answer your question? [Should I check in node\_modules to git when creating a node.js app on Heroku?](https://stackoverflow.com/questions/11459475/should-i-check-in-node-modules-to-git-when-creating-a-node-js-app-on-heroku) – Chris Jun 15 '20 at 22:18
  • Problem solved. Thanks! – Will Jun 15 '20 at 22:34

0 Answers0