Skip to content

[BUG] rm.all doesn't delete anything on Windows #165

@peterhirn

Description

@peterhirn

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

  • version 17.0.4
  • node 19.6
  • this is a windows only bug, works as expected in node:19.6.0-alpine
import cacache from "cacache"

const cachePath = "./cache"
const key = "test-key"

await cacache.put(cachePath, key, "10293801983029384")

const cached = await cacache.get(cachePath, key)
console.log(`Data: ${cached.data}`)

await cacache.rm.all(cachePath)

const cached2 = await cacache.get(cachePath, key)
console.log(`Data after rm.all: ${cached2.data}`)

Output

Data: 10293801983029384
Data after rm.all: 10293801983029384

After rm.all cache keys still exist and nothing is delete from the filesystem.

Expected Behavior

Exception: NotFoundError: No cache entry for test-key found in ./cache

Works as expected in version 16.1.3

Steps To Reproduce

No response

Environment

  • Node: 19.6
  • OS: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions