javascript – Problems with Deploy NodeJS to Heroku

Question:

I have this situation, I have a project mounted on Heroku and I update it via git, but for some time now it won't let me do git push heroku master me this error, I have tried to do several things, but the error persists, does anyone know what is it due to?

      npm ERR! code ELIFECYCLE
       npm ERR! errno 1
       npm ERR! sqlite3@4.0.6 install: `node-pre-gyp install --fallback-to-build`
       npm ERR! Exit status 1
       npm ERR! 
       npm ERR! Failed at the sqlite3@4.0.6 install script.
       npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.ZJa3F/_logs/2019-11-16T01_27_11_336Z-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

       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

Port setting in the app:

app.set('port', process.env.PORT || 4000); //puerto y asì 
app.listen(app.get('port'), () => { 
          console.log('App listening on port ${app.get('port')}'); 
//console.log(hostname) 
}); 

Answer:

I want to start by pointing out that this answer is not trying to answer why the error occurred, but instead aims to point out why it is not recommended to use SQLite on Heroku .

Here is a translated snippet from the SQLite on Heroku article:

[…] SQLite runs in memory and backs up its data store to files on disk. While this strategy works well for development, Heroku's Cedar stack has an ephemeral file system . You can write to it and read it, but the content will be periodically deleted. If you were to use SQLite on Heroku , you would lose your entire database at least once every 24 hours.

Even if Heroku 's disks were persistent running SQLite , it wouldn't fit well. Since SQLite does not run as a service, each test suite would run a separate running copy. Each of these copies needs its own disk-backed store. This would mean that each dyno that feeds your application would have a different set of data since the disks are not in sync.[…]

In other words, barring some very special use case, it's not a good idea to use SQLite on Heroku .

Scroll to Top