Skip to content

Commit 5fc02ca

Browse files
authored
fix(misc): report should not throw when no nx.json file is present (#19333)
1 parent df83e0e commit 5fc02ca

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/nx/src/utils/plugins/installed-plugins.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { readJsonFile } from '../fileutils';
77
import { PackageJson, readModulePackageJson } from '../package-json';
88
import { workspaceRoot } from '../workspace-root';
99
import { join } from 'path';
10-
import { NxJsonConfiguration } from '../../config/nx-json';
10+
import { NxJsonConfiguration, readNxJson } from '../../config/nx-json';
1111
import { getNxRequirePaths } from '../installation-directory';
1212

1313
export function findInstalledPlugins(): PackageJson[] {
@@ -56,9 +56,7 @@ function getDependenciesFromPackageJson(
5656
}
5757

5858
function getDependenciesFromNxJson(): string[] {
59-
const { installation } = readJsonFile<NxJsonConfiguration>(
60-
join(workspaceRoot, 'nx.json')
61-
);
59+
const { installation } = readNxJson();
6260
if (!installation) {
6361
return [];
6462
}

0 commit comments

Comments
 (0)