Skip to content

Commit cd6840b

Browse files
committed
ci: add error on ci for global packages
1 parent ed4b7ad commit cd6840b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/ci.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ function cmd(cb) {
1919
}
2020

2121
async function ci () {
22-
const where = npm.flatOptions.global
23-
? globalTop
24-
: npm.prefix
22+
if (npm.flatOptions.global) {
23+
const err = new Error('`npm ci` does not work for global packages')
24+
err.code = 'ECIGLOBAL'
25+
throw err
26+
}
2527

28+
const where = npm.prefix
2629
const arb = new Arborist({ ...npm.flatOptions, path: where })
2730

2831
try {

0 commit comments

Comments
 (0)