Skip to content

Commit f9f6a63

Browse files
committed
fix(ci): should not use package-lock config
`npm ci` should never be affected by the `package-lock` config. Fixes: #4185
1 parent 5a84e65 commit f9f6a63

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

docs/content/using-npm/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,8 @@ When package package-locks are disabled, automatic pruning of extraneous
11901190
modules will also be disabled. To remove extraneous modules with
11911191
package-locks disabled use `npm prune`.
11921192

1193+
This configuration does not affect `npm ci`.
1194+
11931195
<!-- automatically generated, do not edit manually -->
11941196
<!-- see lib/utils/config/definitions.js -->
11951197

lib/commands/ci.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class CI extends ArboristWorkspaceCmd {
3737
const where = this.npm.prefix
3838
const opts = {
3939
...this.npm.flatOptions,
40+
packageLock: true, // npm ci should never skip lock files
4041
path: where,
4142
log,
4243
save: false, // npm ci should never modify the lockfile or package.json

lib/utils/config/definitions.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,8 @@ define('package-lock', {
14171417
When package package-locks are disabled, automatic pruning of extraneous
14181418
modules will also be disabled. To remove extraneous modules with
14191419
package-locks disabled use \`npm prune\`.
1420+
1421+
This configuration does not affect \`npm ci\`.
14201422
`,
14211423
flatten: (key, obj, flatOptions) => {
14221424
flatten(key, obj, flatOptions)

tap-snapshots/test/lib/utils/config/definitions.js.test.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,8 @@ will also prevent _writing_ \`package-lock.json\` if \`save\` is true.
12711271
When package package-locks are disabled, automatic pruning of extraneous
12721272
modules will also be disabled. To remove extraneous modules with
12731273
package-locks disabled use \`npm prune\`.
1274+
1275+
This configuration does not affect \`npm ci\`.
12741276
`
12751277

12761278
exports[`test/lib/utils/config/definitions.js TAP > config description for package-lock-only 1`] = `

tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,8 @@ When package package-locks are disabled, automatic pruning of extraneous
10641064
modules will also be disabled. To remove extraneous modules with
10651065
package-locks disabled use \`npm prune\`.
10661066
1067+
This configuration does not affect \`npm ci\`.
1068+
10671069
<!-- automatically generated, do not edit manually -->
10681070
<!-- see lib/utils/config/definitions.js -->
10691071

0 commit comments

Comments
 (0)