From c371f183ebe833c2439e98b679f14e7a59f22c34 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 23 Apr 2021 17:49:51 -0700 Subject: ls: do not warn on missing optional deps There was code checking node[_type], but we didn't include that field on the object that is actually checked when we are looking for problems. Fix: #3137 PR-URL: https://github.com/npm/cli/pull/3140 Credit: @isaacs Close: #3140 Reviewed-by: @ruyadorno --- lib/ls.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/ls.js') diff --git a/lib/ls.js b/lib/ls.js index a6f3fbcd9..ccd8b2ff9 100644 --- a/lib/ls.js +++ b/lib/ls.js @@ -414,9 +414,11 @@ const augmentNodesWithMetadata = ({ path: node.path, isLink: node.isLink, realpath: node.realpath, + [_type]: node[_type], [_invalid]: node[_invalid], [_missing]: node[_missing], - [_dedupe]: true, + // if it's missing, it's not deduped, it's just missing + [_dedupe]: !node[_missing], } } else { // keeps track of already seen nodes in order to check for dedupes -- cgit v1.2.3