mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-10 18:18:56 -04:00
fix: don't print unnecessary warning in project that uses hoisted node_modules
This commit is contained in:
6
.changeset/smart-forks-march.md
Normal file
6
.changeset/smart-forks-march.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/core": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't print an unnecessary warning when adding new dependencies to a project that uses hoisted node_modules.
|
||||
@@ -898,13 +898,6 @@ type InstallFunction = (
|
||||
) => Promise<InstallFunctionResult>
|
||||
|
||||
const _installInContext: InstallFunction = async (projects, ctx, opts) => {
|
||||
if (opts.lockfileOnly && ctx.existsCurrentLockfile) {
|
||||
logger.warn({
|
||||
message: '`node_modules` is present. Lockfile only installation will make it out-of-date',
|
||||
prefix: ctx.lockfileDir,
|
||||
})
|
||||
}
|
||||
|
||||
// The wanted lockfile is mutated during installation. To compare changes, a
|
||||
// deep copy before installation is needed. This copy should represent the
|
||||
// original wanted lockfile on disk as close as possible.
|
||||
@@ -1396,6 +1389,12 @@ const installInContext: InstallFunction = async (projects, ctx, opts) => {
|
||||
stats,
|
||||
}
|
||||
}
|
||||
if (opts.lockfileOnly && ctx.existsCurrentLockfile) {
|
||||
logger.warn({
|
||||
message: '`node_modules` is present. Lockfile only installation will make it out-of-date',
|
||||
prefix: ctx.lockfileDir,
|
||||
})
|
||||
}
|
||||
return await _installInContext(projects, ctx, opts)
|
||||
} catch (error: any) { // eslint-disable-line
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user