From 4a1e7ebd571b6ed0caa503de5bede7dc2947bf68 Mon Sep 17 00:00:00 2001 From: Keraito Date: Wed, 9 May 2018 16:03:28 +0200 Subject: [PATCH] Ignore any unstructured output from the package managers --- lib/cli/lib/latest_version.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/cli/lib/latest_version.js b/lib/cli/lib/latest_version.js index aea0ba3798de..97cd4864aa32 100644 --- a/lib/cli/lib/latest_version.js +++ b/lib/cli/lib/latest_version.js @@ -32,10 +32,14 @@ export default function latestVersion(packageName) { }); command.stderr.on('data', data => { - // yarn error - const info = JSON.parse(data); - if (info.type === 'error') { - reject(new Error(info.data)); + try { + // yarn error + const info = JSON.parse(data); + if (info.type === 'error') { + reject(new Error(info.data)); + } + } catch (e) { + // package manager unstructured info/warnings output } }); });