Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly detect the active Node js version during headless installation #7801

Merged
merged 3 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/nasty-goats-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@pnpm/core": patch
"pnpm": patch
---

Correctly detect the active Node.js version during headless installation [#7801](https://github.com/pnpm/pnpm/pull/7801).
2 changes: 1 addition & 1 deletion config/package-is-installable/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ export function checkPackage (
pnpm: options.pnpmVersion,
})
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function filterLockfileByEngine (

export interface FilterLockfileOptions {
currentEngine: {
nodeVersion: string
nodeVersion?: string
pnpmVersion: string
}
engineStrict: boolean
Expand Down Expand Up @@ -92,7 +92,7 @@ function pickPkgsWithAllDeps (
importerIdSet: Set<string>,
opts: {
currentEngine: {
nodeVersion: string
nodeVersion?: string
pnpmVersion: string
}
engineStrict: boolean
Expand All @@ -119,7 +119,7 @@ function pkgAllDeps (
parentIsInstallable: boolean,
opts: {
currentEngine: {
nodeVersion: string
nodeVersion?: string
pnpmVersion: string
}
engineStrict: boolean
Expand Down
4 changes: 2 additions & 2 deletions pkg-manager/core/src/install/extendInstallOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface StrictInstallOptions {
onlyBuiltDependenciesFile?: string
nodeExecPath?: string
nodeLinker: 'isolated' | 'hoisted' | 'pnp'
nodeVersion: string
nodeVersion?: string
packageExtensions: Record<string, PackageExtension>
ignoredOptionalDependencies: string[]
pnpmfile: string
Expand Down Expand Up @@ -187,7 +187,7 @@ const defaults = (opts: InstallOptions) => {
},
lockfileDir: opts.lockfileDir ?? opts.dir ?? process.cwd(),
lockfileOnly: false,
nodeVersion: process.version,
nodeVersion: opts.nodeVersion,
nodeLinker: 'isolated',
overrides: {},
ownLifecycleHooksStdio: 'inherit',
Expand Down
2 changes: 1 addition & 1 deletion pkg-manager/headless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export interface HeadlessOptions {
childConcurrency?: number
currentLockfile?: Lockfile
currentEngine: {
nodeVersion: string
nodeVersion?: string
pnpmVersion: string
}
dedupeDirectDeps?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export interface ResolutionContext {
preferWorkspacePackages?: boolean
readPackageHook?: ReadPackageHook
engineStrict: boolean
nodeVersion: string
nodeVersion?: string
pnpmVersion: string
registries: Registries
resolutionMode?: 'highest' | 'time-based' | 'lowest-direct'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export interface ResolveDependenciesOptions {
hooks: {
readPackage?: ReadPackageHook
}
nodeVersion: string
nodeVersion?: string
registries: Registries
patchedDependencies?: Record<string, PatchFile>
pnpmVersion: string
Expand Down