mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-28 02:53:15 -04:00
fix: store prune should not fail if the store contains Node.js (#10193)
close #10131
This commit is contained in:
6
.changeset/tidy-teeth-accept.md
Normal file
6
.changeset/tidy-teeth-accept.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/package-store": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
`pnpm store prune` should not fail if the store contains Node.js packages [#10131](https://github.com/pnpm/pnpm/issues/10131).
|
||||
@@ -75,7 +75,8 @@ export async function prune ({ cacheDir, storeDir }: PruneOptions, removeAlienFi
|
||||
let pkgCounter = 0
|
||||
await Promise.all(pkgIndexFiles.map(async (pkgIndexFilePath) => {
|
||||
const { files: pkgFilesIndex } = await readV8FileStrictAsync<PackageFilesIndex>(pkgIndexFilePath)
|
||||
if (removedHashes.has(pkgFilesIndex['package.json'].integrity)) {
|
||||
// TODO: implement prune of Node.js packages, they don't have a package.json file
|
||||
if (pkgFilesIndex['package.json'] && removedHashes.has(pkgFilesIndex['package.json'].integrity)) {
|
||||
await fs.unlink(pkgIndexFilePath)
|
||||
pkgCounter++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user