Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ls.js
diff options
context:
space:
mode:
authornlf <quitlahok@gmail.com>2021-04-15 20:35:51 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2021-04-22 16:49:46 +0300
commit42ca59eeedd3e402aa1c606941f7f52864e6039b (patch)
tree48850769adba5ada1828f8c7309c5b28a8063ebc /lib/ls.js
parenta4e7f4e4b40d645fed97622a97c7fa72aa5da82b (diff)
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
Diffstat (limited to 'lib/ls.js')
-rw-r--r--lib/ls.js5
1 files changed, 4 insertions, 1 deletions
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' }