Skip to content

Commit

Permalink
fix(core): do not run postinstall unless it is the main nx package (#…
Browse files Browse the repository at this point in the history
…12591)

(cherry picked from commit 0961cb3)
  • Loading branch information
FrozenPandaz committed Oct 14, 2022
1 parent 731f839 commit 8f6eb81
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/nx/bin/compute-project-graph.ts
Expand Up @@ -6,7 +6,7 @@ import { daemonClient } from '../src/daemon/client/client';

(async () => {
try {
if (fileExists(join(workspaceRoot, 'nx.json'))) {
if (isMainNxPackage() && fileExists(join(workspaceRoot, 'nx.json'))) {
try {
await daemonClient.stop();
} catch (e) {}
Expand All @@ -27,3 +27,11 @@ import { daemonClient } from '../src/daemon/client/client';
}
}
})();

function isMainNxPackage() {
const mainNxPath = require.resolve('nx', {
paths: [workspaceRoot],
});
const thisNxPath = require.resolve('nx');
return mainNxPath === thisNxPath;
}

0 comments on commit 8f6eb81

Please sign in to comment.