Rust E0463 构建 Dioxus Fullstack,但安装了 wasm32-unknown-unknown 目标

问题描述 投票:0回答:1

运行

dx build --features web --release
cargo build --target wasm32-unknown-unknown
返回以下错误:

[INFO] 🚅 Running build command...
error: Broken pipe (os error 32)
Error: 🚫 Building project failed: error[E0463]: can't find crate for `std`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

但是,当我运行

rustup target add wasm32-unknown-unknown
时,它会打印

info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date

当我运行

rustup show
时,目标似乎已安装:

Default host: aarch64-apple-darwin
rustup home:  /Users/myhomedir/.rustup

installed targets for active toolchain
--------------------------------------

aarch64-apple-darwin
wasm32-unknown-unknown

active toolchain
----------------

stable-aarch64-apple-darwin (default)
rustc 1.76.0 (07dca489a 2024-02-04)

我不明白为什么没有为此目标编译标准库。

rust webassembly toolchain dioxus
1个回答
0
投票

事实证明 Rust 是通过

homebrew
rustup
安装的。删除自制软件安装解决了这个问题。感谢这个答案:https://stackoverflow.com/a/74549777/22985331

© www.soinside.com 2019 - 2024. All rights reserved.