Skip to content

fix: store prune should not fail if the store contains Node.js#10193

Merged
zkochan merged 1 commit intomainfrom
fix/prune
Nov 17, 2025
Merged

fix: store prune should not fail if the store contains Node.js#10193
zkochan merged 1 commit intomainfrom
fix/prune

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented Nov 17, 2025

close #10131

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where pnpm store prune would fail when the store contains Node.js packages. Node.js packages don't have a package.json file in their file index, which caused the previous code to attempt to access a property on undefined, leading to a crash.

  • Added a null safety check to skip Node.js packages during pruning
  • Added a TODO comment to track future implementation of Node.js package pruning
  • Added a changeset documenting the fix

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
store/package-store/src/storeController/prune.ts Added null check for pkgFilesIndex['package.json'] before accessing its integrity property to prevent crashes when processing Node.js packages
.changeset/tidy-teeth-accept.md Documents the bug fix for the patch release

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zkochan zkochan merged commit 09bb8db into main Nov 17, 2025
16 of 19 checks passed
@zkochan zkochan deleted the fix/prune branch November 17, 2025 22:45
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.

Installing node as runtime dependency breaks store prune/status

2 participants