diff --git a/packages/js/src/generators/release-version/utils/resolve-version-spec.spec.ts b/packages/js/src/generators/release-version/utils/resolve-version-spec.spec.ts index a767f8e970b06..72c95886ed3e7 100644 --- a/packages/js/src/generators/release-version/utils/resolve-version-spec.spec.ts +++ b/packages/js/src/generators/release-version/utils/resolve-version-spec.spec.ts @@ -76,7 +76,7 @@ describe('resolveVersionSpec()', () => { 'projectA', '1.0.0', 'link:../projectB', - '/packages/fuck' + '/packages/projectB' ) ).toEqual(expect.stringContaining(join('/packages/projectB'))); }); diff --git a/packages/js/src/generators/release-version/utils/resolve-version-spec.ts b/packages/js/src/generators/release-version/utils/resolve-version-spec.ts index 81a4d87ace2d5..324887fb3e583 100644 --- a/packages/js/src/generators/release-version/utils/resolve-version-spec.ts +++ b/packages/js/src/generators/release-version/utils/resolve-version-spec.ts @@ -1,4 +1,5 @@ import * as npa from 'npm-package-arg'; +import { normalizePath } from '@nx/devkit'; export function resolveVersionSpec( name: string, @@ -26,5 +27,7 @@ export function resolveVersionSpec( const npaResult = npa.resolve(name, spec, location); - return npaResult.fetchSpec; + return npaResult.fetchSpec.includes('\\') + ? normalizePath(npaResult.fetchSpec) + : npaResult.fetchSpec; }