diff --git a/.changeset/tough-hounds-laugh.md b/.changeset/tough-hounds-laugh.md new file mode 100644 index 0000000000..7c8b90932f --- /dev/null +++ b/.changeset/tough-hounds-laugh.md @@ -0,0 +1,6 @@ +--- +"@pnpm/fs.indexed-pkg-importer": patch +"pnpm": patch +--- + +Don't fail in Windows CoW if the file already exists [#7554](https://github.com/pnpm/pnpm/issues/7554). diff --git a/fs/indexed-pkg-importer/src/index.ts b/fs/indexed-pkg-importer/src/index.ts index ba53a54e9a..cd601b1a55 100644 --- a/fs/indexed-pkg-importer/src/index.ts +++ b/fs/indexed-pkg-importer/src/index.ts @@ -136,7 +136,7 @@ function createCloneFunction (): CloneFunction { // If the file already exists, then we just proceed. // This will probably only happen if the package's index file contains the same file twice. // For instance: { "index.js": "hash", "./index.js": "hash" } - if (!err.message.startsWith('File exists')) throw err + if (!err.message.startsWith('File exists') && !err.message.includes('-2147024816')) throw err } } }