I have avoided the need to create native applications with a GUI so far, but eventually I'd like to create a program that has a graphical user interface but runs on a local machine (opposed to a web application).
I came across this thread:
Unfortunately it has just been closed 11 hours ago, and I have a few questions yet, so I'm going to ask them in this new thread.
I also stumbled upon Tauri. I tried to follow the guide. I don't fully understand if I need "npm" or not. When I try to follow the first step
npm create tauri-app
I get:
/usr/home/jbe/.npm/_npx/b58944764482de26/node_modules/create-tauri-app/index.js:242
throw loadError;
^
Error: Cannot find module 'create-tauri-app-freebsd-x64'
Require stack:
- /usr/home/jbe/.npm/_npx/b58944764482de26/node_modules/create-tauri-app/index.js
- /usr/home/jbe/.npm/_npx/b58944764482de26/node_modules/create-tauri-app/create-tauri-app.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/usr/home/jbe/.npm/_npx/b58944764482de26/node_modules/create-tauri-app/index.js:152:25)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/home/jbe/.npm/_npx/b58944764482de26/node_modules/create-tauri-app/index.js',
'/usr/home/jbe/.npm/_npx/b58944764482de26/node_modules/create-tauri-app/create-tauri-app.js'
]
}
npm ERR! code 1
npm ERR! path /usr/home/jbe/rust-experiment/gui
npm ERR! command failed
npm ERR! command sh -c /tmp/npx-1661435583362.sh
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jbe/.npm/_logs/2022-08-25T13_53_03_208Z-debug-0.log
Maybe it's because the npm
package for FreeBSD is old? When I install a new npm
version through the system's npm as user, it will install a new version but still start the old version when I invoke npm
.
% npm --version
8.13.0
When I try
cargo install tauri-cli
I get:
error[E0425]: cannot find function `bundle_update` in this scope
--> /home/jbe/.cargo/registry/src/github.com-1ecc6299db9ec823/tauri-bundler-1.0.5/src/bundle/updater_bundle.rs:31:25
|
31 | let bundle_result = bundle_update(settings, bundles)?;
| ^^^^^^^^^^^^^ not found in this scope
For more information about this error, try `rustc --explain E0425`.
error: could not compile `tauri-bundler` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `tauri-cli v1.0.5`, intermediate artifacts can be found at `/tmp/cargo-installkhQ4mP`
I don't know if Tauri is meant to run under FreeBSD at all? I would like my app to run under FreeBSD, Linux, Windows, and macOS.
Maybe I should start with wry
first? After a quick search, I didn't see support for FreeBSD either. Though many things made for Linux work on FreeBSD as well.
I just tried the Hello World example in wry
's README, and it runs without worries. So perhaps that's what I'll do. But maybe there are other good alternatives?
Happy to hear about experiences with any sort of toolkit, so I can better decide which way to go. Currently, I'd probably try wry
first.
Trying to understand wry
's documentation on docs.rs, I don't really see how I have to use it if I want to create a simple GUI application that runs locally on my machine. The Hello World example opens a website through HTTPS, which isn't what I want. I feel a bit lost and don't know where or how to start.
The last time I built a GUI was over two decades ago and on Windows, and otherwise I have only create web applications so far, so my knowledge is very limited. Perhaps someone can give me a good starting point.