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?
Asked
Active
Viewed 6,791 times
19

Shepmaster
- 388,571
- 95
- 1,107
- 1,366

sidoshi
- 2,040
- 2
- 15
- 30
1 Answers
22
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:

Peter Hall
- 53,120
- 14
- 139
- 204