Repository: tauri
Issue: [bug] Tauri CLI fails to correctly install/remove dependencies in a pnpm workspace
Labels: type: bug,status: needs triage

### Describe the bug

I follow the documentation to install plugin using the `tauri add` command. But it fails when installing NPM dependency.
```bash
pnpm tauri add cli
```
```bash
> @readest/readest-app@0.8.0 tauri /Users/chrox/dev/readest/apps/readest-app
> tauri "add" "cli"

    Info Installing Cargo dependency "tauri-plugin-cli"...
    Info Installing NPM dependency "@tauri-apps/plugin-cli@>=2"...
Failed to install NPM dependency
    Error Failed to install NPM dependency
 ELIFECYCLE  Command failed with exit code 1.
```

### Reproduction

_No response_

### Expected behavior

_No response_

### Full `tauri info` output

```text
➜  readest-app git:(main) ✗ pnpm tauri info

> @readest/readest-app@0.8.0 tauri /Users/chrox/dev/readest/apps/readest-app
> tauri "info"

WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: Mac OS 14.3.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 22.9.0
    - pnpm: 9.14.4
    - yarn: 1.22.22
    - npm: 10.9.1

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-http 🦀: 2.0.4
    - @tauri-apps/plugin-http : 2.0.1
    - tauri-plugin-fs 🦀: 2.1.0
    - @tauri-apps/plugin-fs : 2.0.3
    - tauri-plugin-os 🦀: 2.0.1
    - @tauri-apps/plugin-os : 2.0.0
    - tauri-plugin-updater 🦀: 2.1.0
    - @tauri-apps/plugin-updater : 2.0.0
    - tauri-plugin-process 🦀: 2.0.1
    - @tauri-apps/plugin-process : 2.0.0
    - tauri-plugin-dialog 🦀: 2.0.4
    - @tauri-apps/plugin-dialog : 2.0.1
    - tauri-plugin-log 🦀: 2.0.3
    - @tauri-apps/plugin-log : 2.0.1
    - tauri-plugin-shell 🦀: 2.0.2
    - @tauri-apps/plugin-shell : 2.0.1
    - tauri-plugin-cli 🦀: 2.0.1
    - @tauri-apps/plugin-cli : not installed!

[-] App
    - build-type: bundle
    - CSP: img-src 'self' blob: data: asset: http://asset.localhost; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: asset: http://asset.localhost https://*.sentry.io https://*.posthog.com; connect-src 'self' blob: asset: http://asset.localhost ipc: http://ipc.localhost https://*.sentry.io https://*.posthog.com https://*.deepl.com https://*.wikipedia.org https://*.wiktionary.org; style-src 'self' 'unsafe-inline' blob: asset: http://asset.localhost; default-src 'self' 'unsafe-inline' blob: customprotocol: asset: http://asset.localhost ipc: http://ipc.localhost https://fonts.gstatic.com; frame-src 'self' blob: asset: http://asset.localhost
    - frontendDist: ../out
    - devUrl: http://localhost:3000/
    - framework: React (Next.js)
    - bundler: Webpack
```


### Stack trace

_No response_

### Additional context

The `WARNING: no lock files found, defaulting to npm` is because `pnpm-lock.yaml` file is in the root dir of the monorepo. And when running `tauri add` command in the root dir I got similar error:

```
➜  readest git:(main) ✗ pnpm tauri add cli

> @readest/monorepo@ tauri /Users/chrox/dev/readest
> pnpm --filter @readest/readest-app tauri "add" "cli"


> @readest/readest-app@0.8.0 tauri /Users/chrox/dev/readest/apps/readest-app
> tauri "add" "cli"

    Info Installing Cargo dependency "tauri-plugin-cli"...
    Info Installing NPM dependency "@tauri-apps/plugin-cli@>=2"...
Failed to install NPM dependency
    Error Failed to install NPM dependency
/Users/chrox/dev/readest/apps/readest-app:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @readest/readest-app@0.8.0 tauri: `tauri "add" "cli"`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.
```