`/bin/sh: cargo: command not found`
Banyc opened this issue · comments
I'm using the macOS system. The Rust Explorer Log said:
[...] [INFO] Test Explorer found
[...] [INFO] Initializing Rust adapter
[...] [INFO] Loading Rust Tests
[...] [DEBUG] Unable to parse cargo metadata output. Details: Error: Command failed: cargo metadata --no-deps --format-version 1
/bin/sh: cargo: command not found
According to the amount of emojis at electron/electron#7688 (comment), it seems like macOS and Linux systems see this problem frequently. The comment provided https://github.com/sindresorhus/fix-path as a solution. I don't have an npm
environment installed so not sure if that will fix the problem but hey according to those emojis...
Thanks for reaching out. Can you first confirm that cargo
is on your path, as detailed in the under the "Configuring the PATH environment variable" section on https://www.rust-lang.org/tools/install? You should be able to do this from any terminal and running something like cargo --version
Thanks! Running the install script and then relaunching vscode fixes the problem!