From cebf921cb5c90ef66472e1381498b3f2121aab0b Mon Sep 17 00:00:00 2001 From: Joseph Huckaby Date: Sun, 9 Jun 2024 22:57:50 -0700 Subject: [PATCH] Added error for installing on machines with less than 64 MB RAM. --- bin/install.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/install.js b/bin/install.js index d36d2f4e..18531e14 100755 --- a/bin/install.js +++ b/bin/install.js @@ -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";