From e17f998fb76bcee606076baa4868b1dd7f1555d4 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Sun, 28 Apr 2019 23:04:51 +0200
Subject: [PATCH] fix(npm): catch disk-space error in stderr

---
 lib/manager/npm/post-update/npm.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/manager/npm/post-update/npm.js b/lib/manager/npm/post-update/npm.js
index 7a4d89c1f8..ad6271f3c4 100644
--- a/lib/manager/npm/post-update/npm.js
+++ b/lib/manager/npm/post-update/npm.js
@@ -104,6 +104,10 @@ async function generateLockFile(
       stdout += dedupeRes.stdout ? dedupeRes.stdout : '';
       stderr += dedupeRes.stderr ? dedupeRes.stderr : '';
     }
+    // istanbul ignore if
+    if (stderr && stderr.includes('ENOSPC: no space left on device')) {
+      throw new Error('disk-space');
+    }
     const duration = process.hrtime(startTime);
     const seconds = Math.round(duration[0] + duration[1] / 1e9);
     lockFile = await fs.readFile(upath.join(cwd, filename), 'utf8');
-- 
GitLab