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 } }); });