mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-18 22:02:53 -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
|
let pkgCounter = 0
|
||||||
await Promise.all(pkgIndexFiles.map(async (pkgIndexFilePath) => {
|
await Promise.all(pkgIndexFiles.map(async (pkgIndexFilePath) => {
|
||||||
const { files: pkgFilesIndex } = await readV8FileStrictAsync<PackageFilesIndex>(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)
|
await fs.unlink(pkgIndexFilePath)
|
||||||
pkgCounter++
|
pkgCounter++
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user