Skip to content

[bug] cli.js failing to detect NodeJS binary named node-18 #6427

@brxken128

Description

@brxken128

Describe the bug

On Fedora 38, the package manager's Node binary is named node-18 (located in /usr/bin/node-18).

This seems to be incompatible with this commit, and running any command (such as pnpm tauri dev) will fail.

Reproduction

  1. Install nodejs via sudo dnf install nodejs
  2. Go to any project that uses Tauri
  3. Call any Tauri command that uses the JS-CLI wrapper, e.g. pnpm tauri dev

Expected behavior

The node-18 binary name should be considered valid, and not cause an error.

Platform and versions

Environment
  › OS: Fedora 38.0.0 X64
  › Node.js: 19.7.0
  › npm: 9.5.0
  › pnpm: 7.29.1
  › yarn: Not installed!
  › rustup: 1.25.2
  › rustc: 1.68.0
  › cargo: 1.68.0
  › Rust toolchain: stable-x86_64-unknown-linux-gnu 

Packages
  › @tauri-apps/cli [NPM]: 2.0.0-alpha.2
  › @tauri-apps/api [NPM]: Not installed! (2.0.0-alpha.0)
  › tauri [RUST]: git+https://github.com/tauri-apps/tauri?rev=d1752fb1f6223fa47d224cb6c62df9b74944a507#d1752fb1f6223fa47d224cb6c62df9b74944a507 (2.0.0-alpha.3),
  › tauri-build [RUST]: git+https://github.com/tauri-apps/tauri?rev=d1752fb1f6223fa47d224cb6c62df9b74944a507#d1752fb1f6223fa47d224cb6c62df9b74944a507 (2.0.0-alpha.1),
  › tao [RUST]: 0.18.1,
  › wry [RUST]: git+https://github.com/tauri-apps/wry?branch=dev#db6618b560b9fbaed7e333bb6bb2463f5196ca17 (0.27.0),

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:1420/
  › framework: React
  › bundler: Vite

App directory structure
  ├─ src-tauri
  ├─ .vscode
  ├─ src
  ├─ public
  ├─ node_modules
  └─ dist

Stack trace

> tauri "dev"

error: The subcommand '/usr/bin/node-18' wasn't recognized

Usage: cargo-tauri [OPTIONS] <COMMAND>

For more information try '--help'
 ELIFECYCLE  Command failed with exit code 2.

Additional context

The Node version mentioned in Platforms and versions was installed via fnm, and is not a binary that produces this error.

Additionally, pnpm tauri info (or any other variation) panics unless @tauri-apps/api is manually removed from the local package.json - I've attached the actual version number next to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions