Skip to content

Cannot write or read cache for themes (ENOENT on cache folder) #257

Open
@slurmulon

Description

@slurmulon

I am suddenly experiencing a problem with the aglio-olio-theme. I'm receiving a ENOENT issue (missing file/directory) on aglio 2.2.0:

Error: Could not get CSS: Error writing cached CSS to file: ENOENT: no such file or directory, open '/Users/adminaccount/Code/clint/ui/node_modules/blot/node_modules/aglio-theme-olio/cache/b0b0865f713b341beb7fe4b90d8e628262a88e6b.css'"

I was able to resolve this error by simply running the following:

mkdir node_modules/blot/node_modules/aglio-theme-olio/cache

The postinstall script for the aglio-theme-* packages could be updated to simply ensure the cache directory exists before the module is used. Alternatively you could check that the cache directory exists just before it's used, using something like mkpath - I personally prefer the latter approach as it prevents the build from getting too crufty.

I also wanted to note that the NO_CACHE=1 flag will not resolve the issue here, which is expected since this flag only prevents the reading of the cache, not the creation of it. Updating this flag to be responsible for both creating and reading the cache is another potential solution here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions