Can't add the dependency for "rand"

hi ..i am new to rust and i am trying to add the dependency for the "rand" crate as rand="0.8.3" as shown in the rust programming language book but its showing the following error....
git --no -pager --git -dir="C:\Users\joy.cargo\registry\index\github.com-1ecc6299db9ec823.git" show origin/HEAD:ra/nd/rand

  • 'git' is not recognized as an internal or external command,
    can somebody please tell what is to be done.
    i am using visual studio as my editor.

thanks in advance..

You need to install git
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

1 Like

hi thank u for your reply..i forgot to mention that i git already installed on my machine before i started work on rust but still this error is coming ..do i have to install git extension on the vs code also coz i m using vs code for rust.
Thanks in advance.

Is Git in your PATH? If you installed Git after launching Visual Studio, Git may be invisible to VS until you restart it.

3 Likes

hi..thanks for your reply..i added git to my path variable and now its working fine..the "rand" dependency is now enabled and i am not getting any error like before..
thank u..

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.