tauri

Unable to add autostart to tauri


npm run tauri add autostart

 > aw-tauri@0.0.0 tauri
 >tauri add autostart

error: unrecognized subcommand 'add'

I am unable to add autostart to my Tauri project. I have tried upgrading to the latest Tauri and reading the docs. No help!


Solution

  • check the current version of your tauri-cli by running cargo tauri --version

    if the version is below 2.0, try to upgrade tauri-cli to version 2 by running cargo install tauri-cli --version "^2.0.0-beta"

    be aware upgrading from version 1 to 2 could introduce breaking changes to other parts of your project.

    Reference: https://v2.tauri.app/reference/cli/#add