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 14, 2022
1 parent 773c0cb commit 0961cb3
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;
}

1 comment on commit 0961cb3

@vercel
Copy link

@vercel vercel bot commented on 0961cb3 Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app

Please sign in to comment.