Skip to content

Commit

Permalink
Added error for installing on machines with less than 64 MB RAM.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuckaby committed Jun 10, 2024
1 parent 5ffd58c commit cebf921
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ if (process.version.match(/^v?(\d+)/) && (parseInt(RegExp.$1) < 16) && !process.
process.exit(1);
}

// Error out if we have low memory
if ((os.totalmem() < 64 * 1024 * 1024) && !process.env['CRONICLE_DANGER']) {
console.error("\nERROR: The current machine has less than 64 MB of total RAM. Cronicle will likely fail to install successfully under such low memory conditions.\n\nTo ignore this error and attempt the install anyway, set a CRONICLE_DANGER environment variable. Do this at your own risk.\n");
process.exit(1);
}

var restore_packages = function() {
// restore packages that npm killed during upgrade
var cmd = "npm install";
Expand Down

0 comments on commit cebf921

Please sign in to comment.