tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
85.6k stars 2.59k forks source link

[bug] does not work when run `tauri ios init` from a globally installed CLI. #10673

Open rdlabo opened 3 months ago

rdlabo commented 3 months ago

Describe the bug

does not work when run tauri ios init from a globally installed CLI. Generated preBuildScripts at gen/apple/project.yml is:

preBuildScripts:
      - script: node tauri ios xcode-script -v --platform

Run script error is Error: Cannot find module '[PATH]/gen/apple/tauri'.

There seems to be a problem here: https://github.com/tauri-apps/tauri/blob/dev/tooling/cli/src/mobile/init.rs#L147-L174

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.4.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.12.2
    - pnpm: 8.9.0
    - yarn: 1.17.3
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 2.0.0-rc.2 (no lockfile)
    - tauri-build [RUST]: no manifest (no lockfile)
    - wry [RUST]: no manifest (no lockfile)
    - tao [RUST]: no manifest (no lockfile)
    - tauri-cli [RUST]: 2.0.0-alpha.7
    - @tauri-apps/api [NPM]: 2.0.0-rc.1
    - @tauri-apps/cli [NPM]: 2.0.0-rc.3

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Rollup

Stack trace

No response

Additional context

No response

Samoy commented 1 month ago

Same issue.

consistent-k commented 1 month ago

Same issue. +1

amrbashir commented 1 month ago

from a globally installed CLI

Is that installed using cargo install or global installation using a Node package manager, for example npm -g install @tauri-apps/cli?