Can I delete the Electron cache on my Mac? Yes, it's safe

Yes, it's safe to deleteDiskmack safety tier: Safe to clean
~/.electron~/Library/Caches/electron

Yes, both Electron cache folders are safe to delete. ~/Library/Caches/electron and the older ~/.electron hold downloaded copies of the Electron runtime, kept only so builds of Electron apps can skip the download step. Delete them and the next npm install of electron fetches the runtime again; that is the entire cost. The apps you actually run, and the projects you have already built, are unaffected.

What it is

Electron is the framework that lets apps like Slack, Discord, and VS Code ship as desktop programs built from web technology. When a project depends on the electron npm package, the install step downloads a prebuilt copy of the runtime, a zip in the neighborhood of 100 MB, and stashes it in a shared cache so future installs of the same version can copy from disk instead of the network. On current setups that cache lives at ~/Library/Caches/electron, where it is used by the electron package's downloader, electron-builder, and friends. Older tooling stored the same kind of zips in ~/.electron in your home folder, and plenty of Macs still carry both.

The cache grows because Electron releases constantly and projects pin specific versions. Every project that wants a different Electron version adds another full runtime download, and updating a single project leaves its old versions behind. An Apple silicon Mac can also accumulate arm64 and x64 copies of the same release if any build targeted Intel. Nothing in here is cleaned automatically, so a year or two of Electron development quietly leaves several gigabytes of zips you will probably never install again.

Is it safe to delete?

Both folders are plain download caches, and deleting them is safe. Projects that already installed Electron keep their own copy of the runtime inside node_modules/electron, apps you have packaged embed the framework inside the .app bundle, and Electron apps you merely use, like Slack or VS Code, ship with their own copy and never read these folders. Nothing you delete here is the only copy of anything.

The one cost is network time. The next time a project installs Electron, the tooling notices the cache is empty and downloads the runtime zip again, which takes a minute or two on a decent connection. If you don't build Electron apps at all and these folders are leftovers from an old tutorial or a dropped dependency, there is no cost whatsoever. Diskmack identifies both Electron cache locations automatically and cleans them the safe way.

How to check its size

In Finder: In Finder, choose Go > Go to Folder (or press Command-Shift-G), type ~/Library/Caches/electron and press Return. Press Command-Up Arrow to jump to the Caches folder with electron selected, then Command-I to see its size. Repeat with ~/.electron; if Finder says the folder can't be found, your Mac only has the newer location.

In Terminal:

du -sh ~/Library/Caches/electron ~/.electron

How to clean it

  1. Quit anything that might be mid-build: Terminal windows running npm install or electron-builder, and editors with build tasks going.
  2. In Finder, choose Go > Go to Folder (Command-Shift-G), type ~/Library/Caches/electron and press Return.
  3. Press Command-Up Arrow so Finder shows the Caches folder with electron selected, then press Command-Delete to move it to the Trash.
  4. Repeat for the older location: Go to Folder, type ~/.electron, then Command-Up Arrow and Command-Delete. If Finder can't find it, that path was never created on your Mac and you can skip it.
  5. Empty the Trash to actually reclaim the space.

There is no official cleaner command for these folders; moving them to the Trash is the supported reset. Each project's next electron install re-downloads just the version that project pins. In the du command above, a 'No such file' line just means that path doesn't exist on your Mac.

Will it come back?

Only if you keep building Electron apps. The next npm install in a project that depends on electron re-downloads that version's runtime into ~/Library/Caches/electron, and electron-builder re-fetches whatever a packaging run needs. Each active project brings back roughly one compressed runtime per pinned version, so a developer with a couple of live Electron projects will see a few hundred megabytes return, not the multi-gigabyte pile of stale versions that built up over the years. If you have stopped Electron work entirely, the folders stay gone.

Common questions

Is this the same as the Cache folders inside Slack or Discord?

No. Slack, Discord, and other Electron apps carry their runtime inside the .app bundle in your Applications folder and keep their caches in per-app folders under ~/Library/Application Support. The folders on this page are developer-side caches that only exist if a Mac has installed Electron from npm at some point.

Will deleting these break Electron apps I use every day?

No. Shipping apps bundle their own copy of the Electron framework inside the .app and never read ~/.electron or ~/Library/Caches/electron. These folders only matter to build tooling, and even that just re-downloads what it needs.

Why do I have both ~/.electron and ~/Library/Caches/electron?

Older versions of the electron package's download helper stored zips in ~/.electron. The current downloader uses the standard macOS cache location instead. A Mac that has done JavaScript work for a while often carries both, and the old one is pure dead weight.

Do I need internet the next time I build?

Yes, once per Electron version. With the cache gone, the next install fetches the runtime zip from Electron's GitHub releases. After that one download, installs of the same version come from the cache again.

Related folders