Unable to retrieve cmd package

cmd_lib = "0.7.8" I added it below the [dependencies] in the Cargo.toml file and when I run cargo.build I get this

Downloading cmd_lib v0.7.8
error: unable to get packages from source

Is this package dead or something?

https://crates.io/crates/cmd_lib

I'm able to add cmd_lib = "0.7.8" to [dependencies] in Cargo.toml and download the crate. It sounds like a network problem, possibly. Are you able to add any crate to your Cargo.toml? Are you able to run curl -L -o cmd_lib.crate https://crates.io/api/v1/crates/cmd_lib/0.7.8/download and get a tar file?

3 Likes

That is strange.

Do you know other crates I can add?

I ran curl -L -o cmd_lib.crate https://crates.io/api/v1/crates/cmd_lib/0.7.8/download and I get this error message.

Invoke-WebRequest : A parameter cannot be found that matches parameter name 'L'.
At line:1 char:6
+ curl -L -o cmd_lib.crate https://crates.io/api/v1/crates/cmd_lib/0.7. ...
+      ~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

PowerShell has a curl alias for Invoke-WebRequest, but the options that Invoke-WebRequest takes are different to the Linux curl tool. This should be equivelant to what @carols10cents posted:

Invoke-WebRequest -OutFile cmd_lib.crate -URI https://crates.io/api/v1/crates/cmd_lib/0.7.8/download

Oh I see, I used git bash instead and I got this file. cmd_lib.crate So what do I do now mate?

.crate files are currently just renamed .tar.gz archives, containing the source code of the crate - if you run tar -xvzf cmd_lib.crate in Git Bash, does the file successfully extract?

If so, that proves your computer is capable of downloading and reading a crate from crates.io, which might mean the issue is something to do with your Cargo installation/config rather than your network as a whole.

1 Like

I see.

It throws this error
bash: -xvzf: command not found unfortunately.