diff --git a/packages/nx/src/adapter/ngcli-adapter.ts b/packages/nx/src/adapter/ngcli-adapter.ts index e5576433262fd..24951869b83ef 100644 --- a/packages/nx/src/adapter/ngcli-adapter.ts +++ b/packages/nx/src/adapter/ngcli-adapter.ts @@ -353,7 +353,10 @@ export class NxScopedHost extends virtualFs.ScopedHost { } read(path: Path): Observable { - if (path === 'angular.json' || path === '/angular.json') { + if ( + (path === 'angular.json' || path === '/angular.json') && + isAngularPluginInstalled() + ) { return this.readMergedWorkspaceConfiguration().pipe( map((r) => Buffer.from(JSON.stringify(toOldFormat(r)))) ); @@ -566,7 +569,10 @@ export class NxScopeHostUsedForWrappedSchematics extends NxScopedHost { } read(path: Path): Observable { - if (path == 'angular.json' || path == '/angular.json') { + if ( + (path === 'angular.json' || path === '/angular.json') && + isAngularPluginInstalled() + ) { const projectJsonConfig = toOldFormat({ projects: Object.fromEntries(getProjects(this.host)), });