There is a bug in typing "cargo install create-tauri-app --locked"

When I am learning on the Website Tauri, but When I am typing " cargo install create-tauri-app --locked" according to the Website Tauri, but there is a bug and I don't know how to solve it?

douxiaobo@192 Rust % cargo install create-tauri-app --locked
    Updating crates.io index
  Installing create-tauri-app v4.2.0
    Updating crates.io index
    Updating crates.io index
   Compiling typenum v1.16.0
   Compiling version_check v0.9.4
   Compiling libc v0.2.149
   Compiling proc-macro2 v1.0.59
   Compiling crc32fast v1.3.2
   Compiling cfg-if v1.0.0
   Compiling unicode-ident v1.0.8
   Compiling quote v1.0.28
   Compiling syn v1.0.109
   Compiling proc-macro-hack v0.5.20+deprecated
   Compiling rle-decode-fast v1.0.3
   Compiling io-lifetimes v1.0.5
   Compiling adler32 v1.2.0
   Compiling bitflags v1.3.2
   Compiling libflate_lz77 v1.2.0
   Compiling lazy_static v1.4.0
   Compiling rustix v0.36.9
   Compiling same-file v1.0.6
   Compiling walkdir v2.3.2
   Compiling generic-array v0.14.6
   Compiling libflate v1.2.0
   Compiling unicode-width v0.1.10
   Compiling anyhow v1.0.86
   Compiling fastrand v1.9.0
   Compiling shell-words v1.1.0
   Compiling zeroize v1.5.7
   Compiling pico-args v0.5.0
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /Users/douxiaobo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.59/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `create-tauri-app v4.2.0`, intermediate artifacts can be found at `/var/folders/w6/m3p5s_493_lfr5qmr1w96x7m0000gn/T/cargo-install9UxNOl`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
douxiaobo@192 Rust % 

Looks like this issue, therefore should be directed on Tauri developers - they have to bump (directly or indirectly) proc_macro2's version to the one compatible with modern Rust.

I see. Thank you. I read the issue, but they never say how to solve it.

It can't be solved on the consumer side (unless you remove --locked to use latest versions, which can theoretically lead to other issues), it has to be fixed by package maintainers.

...and actually, I've filled the issue already - Impossible to install with `--locked` · Issue #757 · tauri-apps/create-tauri-app · GitHub.

1 Like

Okay. I read the issue which you post. Thank you very much.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.