Skip to content

Commit 02fcbb6

Browse files
authored
fix: ensure Arborist constructor gets passed around everywhere for pacote (#5634)
1 parent 4c52d85 commit 02fcbb6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/npm.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const Arborist = require('@npmcli/arborist')
12
const EventEmitter = require('events')
23
const { resolve, dirname, join } = require('path')
34
const Config = require('@npmcli/config')
@@ -310,6 +311,9 @@ class Npm extends EventEmitter {
310311

311312
get flatOptions () {
312313
const { flat } = this.config
314+
// the Arborist constructor is used almost everywhere we call pacote, it's easiest
315+
// to attach it to flatOptions so it goes everywhere without having to touch every call
316+
flat.Arborist = Arborist
313317
if (this.command) {
314318
flat.npmCommand = this.command
315319
}

0 commit comments

Comments
 (0)