Skip to content

emsdk: every Emscripten release you installed, plus a cache that rebuilds system libraries

The Emscripten SDK keeps each installed release with its own compiler, and a cache of compiled system libraries. How to see both, and remove old releases.

4 min read

The Emscripten SDK is a folder you cloned, often ~/emsdk. Every release you install with ./emsdk install adds a full compiler toolchain inside it, and the old ones stay when you activate a newer one. Separately, Emscripten compiles its own system libraries the first time a build needs them and keeps the results in a cache.

Measure it

cd ~/emsdk
du -sh .
du -sh */ 2>/dev/null | sort -h
./emsdk list | grep -i installed

Removing old releases

./emsdk list                # INSTALLED marks what is on disk
./emsdk uninstall <name>    # a name exactly as the list shows it

Keep the release your projects build with. If a project pins an older one, keep that too.

The cache

The cache holds prebuilt system libraries for each configuration you have built with. It lives inside the active release (in the emscripten/cache folder) unless EM_CACHE points elsewhere.

emcc --clear-cache

The next build rebuilds what it needs, which takes noticeably longer the first time.

WebAssembly projects usually come with Node and Rust tooling as well. See Rust and Cargo, node_modules and cross compilers.

Common questions

How do I remove old Emscripten versions?

Run ./emsdk list in your emsdk folder to see what is installed, then ./emsdk uninstall with the exact name of each version you no longer use.

Where is the Emscripten cache?

Inside the active release's emscripten folder, unless EM_CACHE points elsewhere. emcc --clear-cache empties it.

Is it safe to clear the Emscripten cache?

Yes. It holds compiled system libraries that are rebuilt on the next build, which is slower the first time.

Read next