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

issue/5051 - incorrect peer dependencies on v1 lockfile upgrade #7118

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions lib/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ class Install extends ArboristWorkspaceCmd {
const arb = new Arborist(opts)
await arb.reify(opts)

if (arb.originalLockfileVersionOld) {
await arb.reify(opts)
}

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scripts = [
'preinstall',
Expand Down
2 changes: 2 additions & 0 deletions workspaces/arborist/lib/arborist/build-ideal-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
this.idealTree = idealTree
this.installLinks = installLinks
this.legacyPeerDeps = legacyPeerDeps
this.originalLockfileVersionOld = false

this[_usePackageLock] = packageLock
this[_global] = !!global
Expand Down Expand Up @@ -690,6 +691,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
const heading = ancient ? 'ancient lockfile' : 'old lockfile'
if (ancient || !this.options.lockfileVersion ||
this.options.lockfileVersion >= defaultLockfileVersion) {
this.originalLockfileVersionOld = true
log.warn(heading,
`
The ${meta.type} file was created with an old version of npm,
Expand Down