diff options
author | nlf <quitlahok@gmail.com> | 2022-10-04 19:33:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 19:33:43 +0300 |
commit | 02fcbb67e6b7cf78cd6dc996570b0ba58132de22 (patch) | |
tree | 4b9bd0c76720a9cb335c15ddacfd7a5173e86610 | |
parent | 4c52d85b212b191cd10b1ff2f1c2da18ee2c3dc5 (diff) |
fix: ensure Arborist constructor gets passed around everywhere for pacote (#5634)
-rw-r--r-- | lib/npm.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/npm.js b/lib/npm.js index 852d91ad3..fe2ce5c6b 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 } |