In NodeJS, all the packages installed by NPM are stored in the node_modules/ directory. Is there any such directory in Rust? Are the crates installed somewhere globally?
1 Answer
Crates are installed globally for the current user, not per project. Currently, they are stored in <user directory>/.cargo/registry.
- Mac:
/Users/<username>/.cargo/registry - Or, in general on Mac, Linux & Unix:
$HOME/.cargo/registry - Windows 10:
\Users\<username>\.cargo\registry
There is an RFC in progress to standardise this, and use the location that users of each platform would more likely expect.
See also: