error[E0463]: can't find crate for `wasmi`

Hi, Im compiling rust to wasm. When I run the command rustc --target=wasm32-unknown-unknown -o hello.html getting following error.

I already run the command rustup target add wasm32-unknown-unknown
info: component ‘rust-std’ for target ‘wasm32-unknown-unknown’ is up to date

error[E0463]: can't find crate for `wasmi`
1 | extern crate wasmi;
  | ^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.

rustc -V
rustc 1.30.0-nightly (5c875d938 2018-09-24)

rustup -V
rustup 1.13.0 (ea9259c1b 2018-07-16)

You should use cargo and let it handle the dependies for you.

Already, added the dependencies for wasmi. wasmi = "0.4.0"

To build using cargo, you should use cargo build --target wasm32-unknown-unknown. That should do the job.

Building is fine using cargo build --target wasm32-unknown-unknown But I wanted to run the code in server (Rust to WebAssembly).
When I run the command cargo web start --target wasm32-unknown-unknown I’m getting blank page with the message Finished loading Rust wasm module tests.js
So I tried with rustc --target=wasm32-unknown-unknown -o hello.html

rustc is no more able to understand Cargo’s manifest than gcc is able to understand CMake build scripts.

Also, when describing a problem, describe what you’re trying to do, not just how you’re trying to do it. Someone who might know what your problem is and read this thread before your second reply could very well have already moved on.

If you’re having trouble getting wasm code to work, you should write up a minimal reproduction, and describe exactly what you’re doing, what you expect, and what you get. You might also want to start a new thread with a more appropriate title (unless you can rename posts; not sure if you can).