Unable to deploy to Heroku odeNode.js+Express N

Asked 2 months ago, Updated 2 months ago, 3 views

I am building a site with Node.js and Express.

$git add.
$ git commit-am "Heroku"
$ herokur login
Enter email and password~~~~~~~~~~~~~~~
$ heroku addons:create heroku-postgresql:hobby-dev
$ git push heroku master

I am trying to deploy from Ubuntu to Heroku using the above steps.
You will receive the following messages and errors:

Counting objects: 12961, done.
Compressing objects: 100% (11964/11964), done.
fatal —Out of memory, malloc failed (tried to allocate 425298626 bytes)
fatal —The remote end hang up unexpectedly
fatal —The remote end hang up unexpectedly
fatal:write error:bad file descriptor

I wonder if the problem is that there are too many files.
Actually, I don't mean to git add. so many files.
I thought it might be because the file below node_modules is contained.
I tried to remove and commit as follows, but it didn't work.

 git rm --cached-r node_modules/
git commit-m "remove"

I'm a super beginner in Git, Node.js, and Heroku, so I don't care about anything
Please let me know if there is a possible cause.

git node.js ubuntu heroku

2022-09-30 11:06

2 Answers

Change the http.postBuffer value in the git setting to be large enough before pushing.

$git config --global http.postBuffer157286400

Note:
- Git Push Fails-fal:The remote end hang up unexpectedly
- Git push results in fatal:The remote end hang up unexpected - MasK's permission denied.


2022-09-30 11:06

It seems that Heroku's free plan can only use up to 100MB of capacity, and the memory available is limited, so maybe that's the reason.However, it is difficult and difficult to sign up for a paid plan, so I have not been able to verify it.


2022-09-30 11:06

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.