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/ci.js
diff options
context:
space:
mode:
authorclaudiahdz <cghr1990@gmail.com>2020-04-20 20:31:42 +0300
committerisaacs <i@izs.me>2020-05-08 04:12:58 +0300
commite57a99113ca6ab41b7c325830f22f261a4260f89 (patch)
tree1acde8ac42473a3aa363766c4eab5e1f639128bc /lib/ci.js
parent28184a4609252dc4c6edcc047b8778935b81d1bb (diff)
ci: add error on ci for global packages
Diffstat (limited to 'lib/ci.js')
-rw-r--r--lib/ci.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ci.js b/lib/ci.js
index 81cc69f3a..e64bca5d6 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 {