20

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 1

26

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:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.