hey5v
(Wu Weijie)
February 19, 2023, 11:28am
1
error: The subcommand '/usr/bin/node-18' wasn't recognized
USAGE:
cargo-tauri [OPTIONS] <SUBCOMMAND>
For more information try --help
error Command failed with exit code 2.
openSUSE also encountered this problem before, but tauri‘s developers later fixed it.
opened 08:55AM - 04 Oct 22 UTC
closed 04:25PM - 04 Oct 22 UTC
type: bug
status: needs triage
### Describe the bug
https://github.com/tauri-apps/tauri/blob/dev/tooling/cli/n… ode/tauri.js#L15 checks if the node binary is one of `node` or `nodejs`, which results in the following error on the `node` provided by openSUSE packages.
```
error: Found argument '/usr/bin/node17' which wasn't expected, or isn't valid in this context
USAGE:
cargo-tauri [OPTIONS] <SUBCOMMAND>
For more information try --help
```
For reasons I dont fully understand, openSUSE `/usr/bin/node` is provided by this package which contains a little `node.c`
https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-common
which then invokes one of the real node binaries from the node packages which are installed. In my case, it is invoking `/usr/bin/node17` provided by package `nodejs17`.
Probably the motivation for this little .c is that it respects env var `NODE_VERSION` before using `libalternatives`.
As a quick hack, this change worksaround the problem for me:
```diff
-if (binStem === 'node' || binStem === 'nodejs') {
+if (binStem === 'node' || binStem === 'nodejs' || binStem === 'node17') {
```
### Reproduction
1. Run https://hub.docker.com/r/opensuse/tumbleweed
2. Install node `zypper install nodejs-default`
3. Create a demo tauri app
4. Run `npm run tauri`
### Expected behavior
_No response_
### Platform and versions
```
npm run tauri info
> tauri-app@0.0.0 tauri
> tauri "info"
Environment
› OS: openSUSE 20220916 X64
› Node.js: 17.7.1
› npm: 8.5.2
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.60.0
› cargo: 1.63.0
› Rust toolchain: 1.60-x86_64-unknown-linux-gnu
Packages
› @tauri-apps/cli [NPM]: 1.1.1
› @tauri-apps/api [NPM]: 1.1.0
› tauri [RUST]: 1.1.1,
› tauri-build [RUST]: 1.1.1,
› tao [RUST]: 0.14.0,
› wry [RUST]: 0.21.1,
App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
› framework: React
App directory structure
├─ .git
├─ .vscode
├─ public
├─ src-tauri
├─ src
├─ node_modules
└─ dist
```
### Stack trace
_No response_
### Additional context
_No response_
Please be aware that fedora 38, while branched, still has not even reached the beta stage. You are running a testing version and many things that will work on the released versions may not function in a testing version…
This is not the best place to get support on the branched fedora 38, especially related to building apps.
I do not have access to my bookmarks at present, but someone may be able to give you a pointer to the proper support location for F38.
Thanks for assisting in the testing of the upcoming release.
jn64
(Justin Koh)
March 4, 2023, 5:59pm
3
Report to tauri upstream. When they fixed that previous bug , they expected the node binary to match a certain pattern:
if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) {
This does not match node-18
.
1 Like
jmsunseri
(Justin Sunseri)
March 12, 2023, 3:32pm
4
I’m also having this issue on Fedora 37
jmsunseri
(Justin Sunseri)
March 12, 2023, 3:58pm
5
I find it very odd that even though i installed nvm and the binary is ‘node’ the tauri.js script picks up the older node-18 binary. modifying line 8 of tauri.js to
const binStem = 'node'
has temporarily resolved my issue.
1 Like
hey5v
(Wu Weijie)
March 14, 2023, 2:01pm
6
https://rpm.nodesource.com/pub_18.x/fc/37/x86_64/
i’ve tried nodejs official repo instead of the fedora.repo
Should be resolved in version v1.3
of Tauri
See also
1 Like