From 42ca59eeedd3e402aa1c606941f7f52864e6039b Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 15 Apr 2021 10:35:51 -0700 Subject: fix(ls): do not exit with error when all problems are extraneous deps PR-URL: https://github.com/npm/cli/pull/3086 Credit: @nlf Close: #3086 Reviewed-by: @wraithgar, @ruyadorno --- lib/ls.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/ls.js') diff --git a/lib/ls.js b/lib/ls.js index 65b3ddfe7..56d657945 100644 --- a/lib/ls.js +++ b/lib/ls.js @@ -166,7 +166,10 @@ class LS extends BaseCommand { ) } - if (problems.size) { + const shouldThrow = problems.size && + ![...problems].every(problem => problem.startsWith('extraneous:')) + + if (shouldThrow) { throw Object.assign( new Error([...problems].join(EOL)), { code: 'ELSPROBLEMS' } -- cgit v1.2.3