macovedj opened issue #3931:
error[E0463]: can't find crate for \std\`
|
= note: thewasm32-wasitarget may not be installed
= help: consider downloading the target withrustup target add wasm32-wasierror: cannot find macro
printlnin this scope
--> src/main.rs:2:5
|
2 | println!("Hello, world!");
| ^^^^^^^error: requires
sizedlang_itemerror: aborting due to 3 previous errors`
^^^I get this after running
rustc main.rs --target wasm32-wasi
alexcrichton edited issue #3931:
error[E0463]: can't find crate for \`std\` | = note: the `wasm32-wasi` target may not be installed = help: consider downloading the target with `rustup target add wasm32-wasi` error: cannot find macro `println` in this scope --> src/main.rs:2:5 | 2 | println!("Hello, world!"); | ^^^^^^^ error: requires `sized` lang_item error: aborting due to 3 previous errors^^^I get this after running
rustc main.rs --target wasm32-wasi
alexcrichton commented on issue #3931:
Thanks for the report, but as the error is indicating you don't have the
wasm32-wasistandard library for Rust installed. As the readme mentions you'll need to executerustup target add wasm32-wasifirst to install that, then you should be good to go.
alexcrichton closed issue #3931:
error[E0463]: can't find crate for \`std\` | = note: the `wasm32-wasi` target may not be installed = help: consider downloading the target with `rustup target add wasm32-wasi` error: cannot find macro `println` in this scope --> src/main.rs:2:5 | 2 | println!("Hello, world!"); | ^^^^^^^ error: requires `sized` lang_item error: aborting due to 3 previous errors^^^I get this after running
rustc main.rs --target wasm32-wasi
macovedj commented on issue #3931:
@alexcrichton I apologize, I should have mentioned that I've run that command several times. Rerunning it continually yields
info: component 'rust-std' for target 'wasm32-wasi' is up to date
alexcrichton commented on issue #3931:
Hm you may want to ask in the Rust forums about that since this isn't really relevant to wasmtime itself. It might be the case that the
rustcfrom yourPATHisn't arustup-managedrustc, though. If you have two Rust installations that could happen.
ukd1 commented on issue #3931:
I'm also getting this, after following the instructions...not really sure what to ask in the Rust forums, as I've added the target it suggests, and it doesn't work still...
% rustup target add wasm32-wasi info: component 'rust-std' for target 'wasm32-wasi' is up to date % cargo build --target wasm32-wasi Compiling hello-wasm v0.1.0 (/Users/russ/Sites/rc/rust/wasm/hello-wasm) error[E0463]: can't find crate for `std` | = note: the `wasm32-wasi` target may not be installed = help: consider downloading the target with `rustup target add wasm32-wasi` error: cannot find macro `println` in this scope --> src/main.rs:2:5 | 2 | println!("Hello, world!"); | ^^^^^^^ error: requires `sized` lang_item For more information about this error, try `rustc --explain E0463`. error: could not compile `hello-wasm` due to 3 previous errors
ukd1 edited a comment on issue #3931:
I'm also getting this, after following the instructions...not really sure what to ask in the Rust forums, as I've added the target it suggests, and it doesn't work still...
% rustup target add wasm32-wasi info: component 'rust-std' for target 'wasm32-wasi' is up to date % cargo build --target wasm32-wasi Compiling hello-wasm v0.1.0 (/Users/russ/Sites/rc/rust/wasm/hello-wasm) error[E0463]: can't find crate for `std` | = note: the `wasm32-wasi` target may not be installed = help: consider downloading the target with `rustup target add wasm32-wasi` error: cannot find macro `println` in this scope --> src/main.rs:2:5 | 2 | println!("Hello, world!"); | ^^^^^^^ error: requires `sized` lang_item For more information about this error, try `rustc --explain E0463`. error: could not compile `hello-wasm` due to 3 previous errors
sunfishcode commented on issue #3931:
If you run
rustup show, what does it say the default toolchain is?
Last updated: Dec 13 2025 at 21:03 UTC