From 0660cdb607eac140b23f188b87861035aef095f1 Mon Sep 17 00:00:00 2001 From: kchindam-infy Date: Fri, 22 Aug 2025 09:46:51 -0700 Subject: [PATCH] fix: pruning nodes that are only optional and peer from tree --- workspaces/arborist/lib/arborist/build-ideal-tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 1edd0b643b60d..2ea835d177779 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -1528,7 +1528,7 @@ This is a one-time fix-up, please be patient... // root package.json), at which point they won't be optional so // any dependencies still marked as both optional and peer at // this point can be pruned as a special kind of extraneous - if (node.extraneous || (node.peer && node.optional)) { + if (node.extraneous || (node.peer && node.optional && !node.dev && !node.devOptional)) { node.parent = null } }