diff --git a/packages/nx/bin/nx.ts b/packages/nx/bin/nx.ts index 424b582904..c9cc6e5ec5 100644 --- a/packages/nx/bin/nx.ts +++ b/packages/nx/bin/nx.ts @@ -97,7 +97,7 @@ async function main() { } if (!localNx) { - handleMissingLocalInstallation(); + handleMissingLocalInstallation(workspace ? workspace.dir : null); } // this file is already in the local workspace @@ -180,9 +180,11 @@ function resolveNx(workspace: WorkspaceTypeAndRoot | null) { }); } -function handleMissingLocalInstallation() { +function handleMissingLocalInstallation(detectedWorkspaceRoot: string | null) { output.error({ - title: `Could not find Nx modules in this workspace.`, + title: detectedWorkspaceRoot + ? `Could not find Nx modules at "${detectedWorkspaceRoot}".` + : `Could not find Nx modules in this workspace.`, bodyLines: [`Have you run ${chalk.bold.white(`npm/yarn install`)}?`], }); process.exit(1);