From e57a99113ca6ab41b7c325830f22f261a4260f89 Mon Sep 17 00:00:00 2001 From: claudiahdz Date: Mon, 20 Apr 2020 12:31:42 -0500 Subject: [PATCH] ci: add error on ci for global packages --- lib/ci.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ci.js b/lib/ci.js index 81cc69f3acf13..e64bca5d62690 100644 --- a/lib/ci.js +++ b/lib/ci.js @@ -19,10 +19,13 @@ function cmd(cb) { } async function ci () { - const where = npm.flatOptions.global - ? globalTop - : npm.prefix + if (npm.flatOptions.global) { + const err = new Error('`npm ci` does not work for global packages') + err.code = 'ECIGLOBAL' + throw err + } + const where = npm.prefix const arb = new Arborist({ ...npm.flatOptions, path: where }) try {