See Tauri's Docs to prepare for tauri app development.
Clone the repo and run:
npm install
To build and run the app:
npm run tauri dev
Building the App
CI=true npm run tauri build
Debuggable build
npm run tauri build -- --debug
Build macOS App Bundles
Tauri v2 build command for macOS app bundles
npm run tauri build -- --bundles app
Troubleshooting
Resolving Tauri Build Error: "No such file or directory (os error 2)"
The error you're encountering indicates that Tauri is trying to use Rust's Cargo build system, but it cannot find the necessary Rust setup to compile the project. This is likely because either Rust is not installed, or the environment isn’t configured properly for Tauri's Rust dependencies.
Steps to Resolve
1. Install Rust
Tauri uses Rust, so ensure you have the Rust toolchain installed. You can install Rust using rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Set Up Tauri’s Rust Targets
Since you are building for universal-apple-darwin, you will need to install the necessary Rust targets. Use:
After setting up Rust and the necessary targets, try running the build command again:
npm run tauri build -- --debug
Build Errors
Can't find crate for 'core' error...
error[E0463]: can't find crate for `core`
|
= note: the `aarch64-apple-darwin` target may not be installed
= help: consider downloading the target with `rustup target add aarch64-apple-darwin`
For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
failed to build aarch64-apple-darwin binary: failed to build app
Error [tauri_cli_node] failed to build aarch64-apple-darwin binary: failed to build app
In this case, update rustup to the latest version: