Skip to content

fix(deps)!: update tar to 8 and pacote/arborist to the npm 11 stack - #6243

Open
edusperoni wants to merge 1 commit into
mainfrom
chore/npm11-node22-deps
Open

edusperoni wants to merge 1 commit into
mainfrom
chore/npm11-node22-deps

Conversation

@edusperoni

@edusperoni edusperoni commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

PR Checklist

What is the current behavior?

Stacked on #6242. After that PR, a fresh install of the published manifest still reports 13 advisories:

  • tar 7.5.22 (high). About 20 extraction advisories: symlink escapes, PAX header injection, path-reservation memory amplification and others. Almost all are fixed only in 8.x. The CLI extracts every template and platform package with tar.x() in PacoteService.extractPackage.
  • pacote 21 and @npmcli/arborist 9 (moderate). They pull in sigstore, tuf-js, @tufjs/models, npm-packlist, ignore-walk and @npmcli/metavuln-calculator releases that sit on the vulnerable minimatch 10.

What is the new behavior?

  • tar 7.5.22 → 8.1.2, pacote 21.5.1 → 22.0.2, @npmcli/arborist 9.1.8 → 10.0.5. The lockfile changes stay inside npm's own package stack, and no dev dependencies change.
  • tar 8 drops Node streams for a promise API. extractPackage now passes the tarball as the input option of tar.x() and awaits it, instead of piping into a writable stream. The previous version also kept going after a failed pacote.tarball(), which now just throws.
  • The extractPackage tests were describe.skip. They now run and extract a real tarball: the strip of package/, the filter option, a fetch error and a corrupt archive.
  • engines.node becomes ^22.22.2 || ^24.15.0 || >=26.0.0, which matches what pacote 22 and @npmcli/arborist 10 declare. The CLI test matrix drops 20.x. The CLI release workflow moves from Node 22.14.0, which is outside the range, to 22.23.5. The doctor package's jobs are unchanged and keep their Node 20 leg.

Audit: a fresh consumer install goes from 13 to 3 (2 moderate, 1 high). All three come from npm's own packages and can only be fixed upstream:

  • tar 7.5.24 (high), via pacote 22 (^7.4.3) and node-gyp 13 (^7.5.4). The CLI's own extraction uses tar 8.
  • minimatch 10.2.6, via @npmcli/arborist 10 and its workspace and package-json helpers (^10.0.3). This is also why @npmcli/arborist itself is flagged.

Verification: npm test passes (141 files, 2450 passed, 0 skipped), and so does tsc -p tsconfig.release.json. I also ran ns create end to end with the built CLI and @nativescript/template-blank-ts, which fetches and extracts through pacote 22 and tar 8.

Notes for review

  • IPacoteExtractOptions.filter in lib/definitions/pacote-service.d.ts now receives a tar.ReadEntry instead of tar.FileStat, which tar 8 no longer exports. No caller in the CLI passes a filter.
  • The release workflow's Node bump is not exercised until the next release.

BREAKING CHANGES:

The CLI no longer supports Node.js 20, which reached end of life in April 2026. The supported range also excludes 22.x before 22.22.2, 24.x before 24.15.0, and the odd releases 23 and 25. On an unsupported version the CLI prints the "Support for Node.js … is not verified" warning, but it still runs. The hard floor in verify-node-version.ts is unchanged.

Migration steps:
Upgrade to Node.js 22.22.2 or later on 22.x, 24.15.0 or later on 24.x, or Node.js 26 and later.

Summary by CodeRabbit

  • New Features
    • Package extraction now omits the archive’s top-level package directory and supports filtering entries with their full archive entry details.
  • Bug Fixes
    • Extraction errors, including invalid archives and download failures, are now reported to callers.
  • Compatibility
    • Supported Node.js versions are now 22.22.2 or later in the 22.x line, 24.15.0 or later in the 24.x line, or 26.x and later.

@edusperoni
edusperoni added this pull request to stack #6244 December 4, 2026 03:03
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

CodeRabbit ASCII loading animation

Currently processing new changes in this PR. This may take a few minutes, please wait...

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0430360c-a1c7-4926-bc82-793ad49299da
Commits

Reviewing files that changed from the base of the PR and between 56fcff8 and 25492be.

Files ignored due to path filters: 1

  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 6

  • .github/workflows/npm_release_cli.yml
  • .github/workflows/tests.yml
  • lib/definitions/pacote-service.d.ts
  • lib/services/pacote-service.ts
  • package.json
  • test/services/pacote-service.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Base automatically changed from chore/npm-audit-deps to main December 4, 2026 03:52
tar 7 is affected by a set of extraction advisories (symlink escapes,
PAX header injection, memory amplification) that are fixed only in
8.x. pacote 21 and @npmcli/arborist 9 pull in sigstore, tuf-js,
npm-packlist and ignore-walk releases affected by the minimatch DoS;
pacote 22 and arborist 10 clear those.

tar 8 replaces the stream API with promises, so extractPackage passes
the tarball as the `input` option of tar.x() and awaits it. The
extractPackage tests now extract a real tarball instead of a stubbed
stream, and run instead of being skipped.

All three packages require Node ^22.22.2 || ^24.15.0 || >=26.0.0, so
the engines range, the test matrix and the release workflow move with
them. The doctor package keeps its own Node 20 leg.

BREAKING CHANGE: Node.js 20 is no longer supported. The CLI requires
Node ^22.22.2 || ^24.15.0 || >=26.0.0.
@edusperoni
edusperoni force-pushed the chore/npm11-node22-deps branch from 9e409ac to 25492be Compare December 4, 2026 03:52
@edusperoni
edusperoni marked this pull request as ready for review December 4, 2026 03:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant