tauri: [bug] failed to get project out directory: failed to get cargo metadata: program not found error Command failed with exit code 1.

Describe the bug

Tauri project created with package manager: yarn and UI template: react-ts I already installed all the requirements. This is what I see in my terminal when I try to run the command yarn tauri dev to start the project. image

Reproduction

  1. Generate project using create tauri-app
  2. Choose yarn package manager
  3. Use react-ts UI template
  4. Run using yarn tauri dev

Expected behavior

No response

Platform and versions

yarn: 1.22.17

Stack trace

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 26 (6 by maintainers)

Commits related to this issue

Most upvoted comments

This is the repository link. I didn’t change anything after the project was created. It’s my first time using tauri, so I don’t know anything, I just installed the requirements

Thanks. Forgot to install rust curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh. Works now.

I just followed the QuickStart guide, it didn’t say anything about prerequisites.

It should link to the prerequisites page.

If there is any other first-timers (like me) getting stuck on this issue, I skipped over the line “Note that you have to restart your terminal, and in some cases, Windows itself, for the changes to take effect.”

Stupid, I know, don’t be like me.

@serg06 All quick start guides have a note at the top: grafik

And create-tauri-app also prints a warning after running it: grafik

Where else could we add a warning, or how should the existing ones look like to avoid this confusion? Feedback is always much appreciated 🙏

An important note for MacOS users. You probably have to restart or log out before rust installation will take effect. That was the case for me on Mojave 10.14.6.

I just ran against this, the only thing that worked was using powershell in windows

I fixed this by restarting the terminal

Restart of VSCode did the job for me.

I actually still get this issue in vs code, even after installing Rust and running it just fine in command prompt, but command prompt in vs code still errors

image

image

EDIT: echo %PATH% has cargo in command prompt but not vs code

I know I’m a dumb dumb for not installing rust first, but it would help if instead of giving the error: Error failed to get cargo metadata: program not found, when running npm run tauri dev, it was somehow able to detect Rust isn’t installed and said Error: Rust is not installed or something similar.

When I google “tauri” and click “quick start” on the first result, I get to https://tauri.app/v1/guides/getting-started/setup/ and the top says “The easiest way to scaffold a new project is the create-tauri-app” which links (of course) here and a tthe top of the readme, I see npm create tauri-app@latest under “npm” (of course) and then run it and got this far. Again, I know I’m a dumb dumb, but I think this would be a very common path that people trying tauri for the first time would follow (somehow landing on the quick start page and/or this repo and then running create tauri-app@latest). Just my two cents. Thanks!

I have the same issue on Windows, ridiculous how it is some kind of linking issue with Windows, even after restarting, obviously have rust and cargo installed.

Ahh i see, you’re totally right! thank you!

@FabianLars Ahh I see. Let me explain how I missed it:

  • I clicked QuickStart on the left sidebar and it brought me here – there is no mention of prerequisites
  • I followed the instructions and ran yarn create tauri-app to create an app
  • I tried to run the app and ran into this error

It would be great if it could be added to that page!