Repository navigation
[pull] main from pnpm:main - #509
Merged
Merged
Conversation
A worker call arriving after the CLI's final finishWorkers() — typically a tarball fetch for a never-linked package (foreign-arch optional dependency) delayed past install completion by a network retry — lazily re-created the worker pool. Nothing ever finished the new pool, so its idle worker thread kept the process alive until an external timeout killed it: pnpm printed 'Done in Xs' and then hung. finishWorkers() now keeps the finished pool's reference. Straggler tasks are still serviced: each spawns a worker in the finished pool, and checkinWorker tears it down again because the pool is finishing. The global.finishWorkers clear (349019b) that fixes Jest chain-accumulation hangs is kept; only the pool-reference clear from 1941ce7 is reverted, and the fetch-after-finishWorkers scenario that commit protected still passes (installing/commands test suite). close #12297
Scope the tarball URL percent-decoding to the public registry
The canonical registry tarball URL check unescaped `%2f`/`%2F` before
comparing, so a scoped package served only from the encoded path (GitHub
Enterprise Server) had its URL classified as canonical and dropped from the
lockfile; the next install rebuilt the unencoded URL and got a 404.
registry.npmjs.org serves a scoped package from both the encoded and the
unencoded path, so the unescape is kept there and encoded npmjs URLs already
recorded in a lockfile keep resolving to `{ integrity }` rather than churning.
Everywhere else the match is now exact apart from the protocol, so the encoded
URL stays in `pnpm-lock.yaml` and is requested verbatim.
Closes #13534
…3931) With a global virtual store, package directories live outside the project, so Node's upward node_modules walk from their real paths never reaches the project's hoisted node_modules — undeclared (phantom) dependencies stop resolving, and Node ignores NODE_PATH entirely for ESM imports (Related to #9618). When enableGlobalVirtualStore is on (and extendNodePath is not disabled), every child process pnpm spawns — run, exec, lifecycle scripts, dlx — now receives NODE_PATH pointing at the private hoist dir and the root node_modules, plus a NODE_OPTIONS --import flag that registers a resolve hook restoring NODE_PATH lookups for ESM, replacing the plugin-esm-node-path config dependency. The flag is a self-contained constant: the registration module and the hook are nested data: URLs, so no loader file has to exist on disk and the flag stays valid regardless of which project or pnpm version spawned the child. It prefers module.registerHooks() (in-thread, no DEP0205 deprecation warning) and falls back to module.register() on Node >=18.19 <22.15. Everything outside the RFC 3986 unreserved set is percent-encoded: encodeURIComponent alone leaves single quotes bare, and the NODE_OPTIONS tokenizer treats those as quote delimiters. Both stacks embed identical hook sources and each asserts its derived flag against the shared golden file pnpm11/exec/esm-node-path-loader/test/import-flag.txt, so they cannot drift apart silently. Where the nodeOptions setting overwrites NODE_OPTIONS (run, exec, recursive run, install lifecycle), the flag is re-applied. pacquet's dlx and global installs force GVS off for their self-contained trees and now strip the injected env from the caller's cloned config, so a tool never resolves phantoms from the invoking project's tree; the TypeScript dlx (GVS on by default) adds the flag and lets the bin shim supply NODE_PATH. This deliberately does not address the TypeScript-compiler side of #13210: tsc, tsserver, and bundlers implement their own resolution and honor neither NODE_PATH nor Node loader hooks. That class remains packageExtensions / compat-DB territory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )