Where Does Nx Store Its Cache and Daemon Data?
Nx caches task outputs in .nx/cache, now shared via ~/.nx, with daemon data in workspace-data. Clearing and relocating the cache.
Last updated
Nx keeps two kinds of local state inside your workspace's .nx folder. The cache directory holds task outputs for a week before aging out. The workspace-data directory holds the daemon's project graph, file map and logs. Both are disposable by design.
Newer Nx versions share one cache across checkouts under ~/.nx to deduplicate work. Point NX_CACHE_DIRECTORY or the cacheDirectory key in nx.json elsewhere to move it, for instance onto faster local storage. When builds behave oddly, npx nx reset clears cache, daemon and workspace data in one shot.
Where Nx stores this, by platform
.nx\cache
Inside your workspace root, shared from %USERPROFILE%\.nx on recent versions. Run npx nx reset to clear cache plus daemon state. Keep .nx out of version control.
.nx/cache
Same workspace-relative role, shared from ~/.nx on recent versions. Override with NX_CACHE_DIRECTORY in env or cacheDirectory in nx.json for custom placement.
.nx/cache
Mirrors macOS exactly. Daemon logs and file maps sit in .nx/workspace-data beside it. CI machines benefit most from pointing the cache at persistent storage.
Frequently asked questions
How do I clear the Nx cache?
Run npx nx reset in the workspace. That wipes cached task outputs, workspace data and restarts the daemon. Add --onlyCache to keep the daemon running, or --onlyDaemon to restart just the background process.
Where does Nx keep the project graph between runs?
In .nx/workspace-data inside the checkout, with a shared copy under ~/.nx/databases on newer versions. Delete it any time; Nx rebuilds it on the next command. Set NX_WORKSPACE_DATA_DIRECTORY to move it.
Notice an outdated path? Let us know.