Skip to content

Commit

Permalink
fix(core): use getNxRequirePaths for more accurate locations of node_…
Browse files Browse the repository at this point in the history
…modules
  • Loading branch information
Coly010 committed Dec 3, 2024
1 parent ac25f68 commit a03c5fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/workspace/src/generators/new/generate-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { NormalizedSchema } from './new';
import { join } from 'path';
import * as yargsParser from 'yargs-parser';
import { fork, ForkOptions } from 'child_process';
import { getNxRequirePaths } from 'nx/src/utils/installation-directory';

export function addPresetDependencies(host: Tree, options: NormalizedSchema) {
const { dependencies, dev } = getPresetDependencies(options);
Expand All @@ -39,8 +40,9 @@ export function generatePreset(host: Tree, opts: NormalizedSchema) {
cwd: newWorkspaceRoot,
};
const pmc = getPackageManagerCommand();
const nxInstallationPaths = getNxRequirePaths(newWorkspaceRoot);
const nxBinForNewWorkspaceRoot = require.resolve('nx/bin/nx', {
paths: [join(newWorkspaceRoot, 'node_modules')],
paths: nxInstallationPaths,
});
const args = getPresetArgs(opts);

Expand Down

0 comments on commit a03c5fa

Please sign in to comment.