Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions workspaces/arborist/lib/arborist/build-ideal-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const { defaultLockfileVersion } = Shrinkwrap
const Node = require('../node.js')
const Link = require('../link.js')
const addRmPkgDeps = require('../add-rm-pkg-deps.js')
const optionalSet = require('../optional-set.js')
const { checkEngine, checkPlatform } = require('npm-install-checks')
const relpath = require('../relpath.js')
const resetDepFlags = require('../reset-dep-flags.js')
Expand Down Expand Up @@ -195,7 +194,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
await this.#applyUserRequests(options)
await this.#buildDeps()
await this.#fixDepFlags()
await this.#pruneFailedOptional()
await this.#throwFailure()
await this.#checkEngineAndPlatform()
} finally {
process.emit('timeEnd', 'idealTree')
Expand Down Expand Up @@ -1496,16 +1495,11 @@ This is a one-time fix-up, please be patient...
}
}

#pruneFailedOptional () {
#throwFailure () {
for (const node of this.#loadFailures) {
if (!node.optional) {
throw node.errors[0]
}

const set = optionalSet(node)
for (const node of set) {
node.parent = null
}
}
}
}
Loading