8 更新依赖
1分钟内可阅读完
更新 npm 包
如果你使用 tauri 包:
包管理器
| |
| |
| |
包管理器
| |
| |
| |
更新 Cargo 包
你可以用 cargo outdated 检查过时的包,或者查看 crates.io 页面:tauri / tauri-build。
进入 src-tauri/Cargo.toml,把 tauri 和 tauri-build 改为
| |
其中 %version% 是上面看到的对应版本号。
然后执行以下操作:
| |
或者,你也可以运行 cargo-edit 提供的 cargo upgrade 命令,它会自动完成这一切。
同步 npm 包与 Cargo crate 版本
由于 JavaScript API 依赖后端的 Rust 代码,新增功能需要同时升级两侧以保证兼容性。请确保 npm 包 @tauri-apps/api 与 cargo crate tauri 处于相同的次要版本。
对于插件,我们可能会在补丁版本中引入这类变更,因此我们会同时提升 npm 包和 cargo crate 的版本,你需要保持精确版本同步。例如,npm 包 @tauri-apps/plugin-fs 与 cargo crate tauri-plugin-fs 需要相同版本(例如 2.2.1)。