Skip to content

Commit

Permalink
fix(lerna): try/catch lerna.json parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Feb 6, 2020
1 parent d650427 commit 9e6b9e7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/manager/npm/extract/index.ts
Expand Up @@ -115,9 +115,14 @@ export async function extractPackageFile(
let lernaPackages: string[];
let lernaClient: 'yarn' | 'npm';
let hasFileRefs = false;
const lernaJson = JSON.parse(
await platform.getFile(join(dirname(fileName), 'lerna.json'))
);
let lernaJson;
try {
lernaJson = JSON.parse(
await platform.getFile(join(dirname(fileName), 'lerna.json'))
);
} catch (err) /* istanbul ignore next */ {
logger.warn({ err }, 'Could not parse lerna.json');
}
if (lernaJson) {
lernaDir = dirname(fileName);
lernaPackages = lernaJson.packages;
Expand Down

0 comments on commit 9e6b9e7

Please sign in to comment.