error[E0463]: can't find crate for `core` / note: the `wasm32-unknown-unknown` target may not be installed [NEAR Protocol]

Viewed 2161

I see this error in the Terminal while building a Rust application (which happens to be about NEAR Protocol, if you're curious):

error[E0463]: can't find crate for core

note: the "wasm32-unknown-unknown" target may not be installed

How can I fix it so that Rust will actually build my NEAR app?

4 Answers

To solve this error, run:

rustup target add wasm32-unknown-unknown

in the terminal, and that should correct the issue.

Note: I'm simply posting here as an answer what the original question asker Dorian Crutcher already wrote within their question. But that suggestion did work for me too.

I had the same problem, its reason is in an out-of-date version of Rust, the solution was to update the Rust to the latest version.

I got a similar error while trying to install universal builds of py38-cryptography via Macports on Mac OS 12.1 with an M1 Max chip.:

:info:build error[E0463]: can't find crate for `core`
:info:build   |
:info:build   = note: the `x86_64-apple-darwin` target may not be installed

Rebuilding Macports' installed version of rust as universal works:

sudo port install rust +universal

May be somebody will help, ubuntu 20.04, just randomly found solution of next error:

error[E0463]: can't find crate for core

Run in terminal, rustup target add wasm32-unknown-unknown

Related