diff --git a/packages/workspace/src/command-line/dep-graph.ts b/packages/workspace/src/command-line/dep-graph.ts index 3f209bda1d..5b68a8ad19 100644 --- a/packages/workspace/src/command-line/dep-graph.ts +++ b/packages/workspace/src/command-line/dep-graph.ts @@ -2,7 +2,8 @@ import { exists, readFile, readFileSync, statSync, writeFileSync } from 'fs'; import { copySync } from 'fs-extra'; import * as http from 'http'; import * as opn from 'opn'; -import { join, normalize, parse } from 'path'; +import { join, normalize, parse, dirname } from 'path'; +import { ensureDirSync } from 'fs-extra'; import * as url from 'url'; import { createProjectGraph, @@ -238,6 +239,8 @@ export function generateGraph( } else if (ext === 'json') { filename = `${folder}/${filename}`; + ensureDirSync(dirname(filename)); + writeFileSync( filename, JSON.stringify(