Skip to content

Commit

Permalink
fix(core): always set root version of npm packages
Browse files Browse the repository at this point in the history
  • Loading branch information
wSedlacek committed Dec 1, 2022
1 parent eda03e5 commit 888d23c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/nx/src/lock-file/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ function mapPackageDependency(
peer,
optional,
};
if (!mappedPackages[packageName][key]) {
const rootVersion =
isRootVersion ?? packagePath.split('/node_modules/').length === 1;

if (!mappedPackages[packageName][key] || rootVersion) {
// const packageDependencies = lockfileVersion === 1 ? requires : dependencies;
const rootVersion =
isRootVersion ?? packagePath.split('/node_modules/').length === 1;

if (lockfileVersion === 1) {
const { requires, ...rest } = value;
Expand Down

0 comments on commit 888d23c

Please sign in to comment.