From 1d24e8024267c181dd56e31091db2ab148a5d4c3 Mon Sep 17 00:00:00 2001 From: Chris Hallberg Date: Mon, 13 Jul 2026 18:01:28 -0400 Subject: [PATCH] fix(arborist): build inventory before calling workspaceNodes Resolves #5863: "workspaces in filter set, but no workspace folder present" warning. When running "npm update", we call Arborist's reify function. Initializing the tree loads the edgesOut and depQueues them, but that queue isn't resolved before we apply user requests. When `applyUserRequests` calls `workspaceNodes`, it is working with an empty inventory. This causes it to throw the warning (see #5863) and always return an empty array. SOLUTION: apply user requests after resolving the dependencies queue. --- workspaces/arborist/lib/arborist/build-ideal-tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 4f3f886e8997a..de612d0db7474 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -184,8 +184,8 @@ module.exports = cls => class IdealTreeBuilder extends cls { await this.#loadNpmExtension() this.#loadPackageExtensions() await this.#inflateAncientLockfile() - await this.#applyUserRequests(options) await this.#buildDeps() + await this.#applyUserRequests(options) await this.#fixDepFlags() await this.#pruneFailedOptional() await this.#checkEngineAndPlatform()