Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use module.enableCompileCache in NodeJS v22 #573

Closed
wants to merge 1 commit into from
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
8 changes: 5 additions & 3 deletions sources/corepackUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,11 @@
// Node.js segfaults when using npm@>=9.7.0 and v8-compile-cache
// $ docker run -it node:20.3.0-slim corepack [email protected] --version
// [SIGSEGV]
if (locator.name !== `npm` || semverLt(locator.reference, `9.7.0`))
// @ts-expect-error - No types
await import(`v8-compile-cache`);
if (locator.name !== `npm` || semverLt(locator.reference, `9.7.0`)) {
if (!Module.enableCompileCache?.())

Check failure on line 407 in sources/corepackUtils.ts

View workflow job for this annotation

GitHub Actions / Testing chores

Property 'enableCompileCache' does not exist on type 'typeof Module'.
// @ts-expect-error - No types
await import(`v8-compile-cache`);
}

// We load the binary into the current process,
// while making it think it was spawned.
Expand Down
Loading