diff --git a/lib/npm.js b/lib/npm.js index 852d91ad3f890..fe2ce5c6b818c 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -1,3 +1,4 @@ +const Arborist = require('@npmcli/arborist') const EventEmitter = require('events') const { resolve, dirname, join } = require('path') const Config = require('@npmcli/config') @@ -310,6 +311,9 @@ class Npm extends EventEmitter { get flatOptions () { const { flat } = this.config + // the Arborist constructor is used almost everywhere we call pacote, it's easiest + // to attach it to flatOptions so it goes everywhere without having to touch every call + flat.Arborist = Arborist if (this.command) { flat.npmCommand = this.command }