Let's back up for a sec... Originally you were running out of space downloading and unpacking packages in ~/.cargo:
Caused by:
failed to unpack `v8-0.106.0/v8/src/wasm/wasm-module-builder.h` into `/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v8-0.106.0/v8/src/wasm/wasm-module-builder.h`
Caused by:
No space left on device (os error 28)
After mounting your USB device on ~/.cargo, you're no longer failing to unpack packages in ~/.cargo. Is this correct? I think it is, because you get much further along in the process and, instead, fail when creating build artifacts in /home/user/bin/runjs:
Compiling deno_unsync v0.4.1
Compiling deno_ops v0.194.0
Compiling serde_v8 v0.227.0
error: failed to build archive at `/home/user/bin/runjs/target/debug/deps/libv8-1578236c8b2c1e9c.rlib`: No space left on device (os error 28)
It seems like you're running cargo init --bin runjs
from ~/bin
, correct?
What if, instead, you run cargo init --bin runjs
from ~/.cargo
, so it's stored on the USB device, instead of in RAM?
And yes, I did run this on my machine, which happens to be macOS. I just tried it on a fresh Debian installation in a VM with the following results (no other cargo projects have been built, so this is the bare minimum, without tweaking build profiles):
root@pve:~# du -sh .cargo runjs
163M .cargo
426M runjs
Well, that's a lot more manageable than the macOS artifacts, at least. 
How big is your root filesystem, as reported by df
?