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
  • Loading branch information
FrozenPandaz committed Oct 13, 2022
1 parent 23de788 commit f1c2b21
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 f1c2b21

Please sign in to comment.