commit
3f1c2248e5
@ -1,10 +1,19 @@ |
||||
# Prerequisites |
||||
|
||||
To run `wasm-pack` you'll need to have both Rust and npm installed and configured. |
||||
First you'll want to [install the `wasm-pack` CLI][wasm-pack], and `wasm-pack |
||||
-V` should print the version that you just installed. |
||||
|
||||
- [Rust](/wasm-pack/book/prerequisites/rust.html) |
||||
- [npm](/wasm-pack/book/prerequisites/npm.html) |
||||
[wasm-pack]: https://rustwasm.github.io/wasm-pack/installer/ |
||||
|
||||
In the future, we intend to rewrite the npm registry client bits so that the need |
||||
for a Node runtime is eliminated. If you're excited about that work- you should |
||||
reach out to the maintainers and get involved! |
||||
Next, since `wasm-pack` is a build tool, you'll want to make sure you have |
||||
[Rust][rust] installed. Make sure `rustc -V` prints out at least 1.30.0. |
||||
|
||||
[rust]: https://www.rust-lang.org/tools/install |
||||
|
||||
Finally, if you're using `wasm-pack` to install to publish to NPM, you'll want |
||||
to [install and configure `npm`][npm]. In the future, we intend to rewrite the |
||||
npm registry client bits so that the need for a Node runtime is eliminated. If |
||||
you're excited about that work- you should reach out to the maintainers and get |
||||
involved! |
||||
|
||||
[npm]: npm.html |
||||
|
@ -1,35 +0,0 @@ |
||||
# Rust |
||||
|
||||
`wasm-pack` is a Command Line Interface tool written in Rust, and distributed with `cargo`. |
||||
As a result, you'll need Rust and `cargo` to use `wasm-pack`. |
||||
|
||||
### Installing Rust and Cargo |
||||
|
||||
To install Rust, visit this [page](https://www.rust-lang.org/en-US/install.html), which will |
||||
walk you through installing Rust and `cargo` on your machine using a tool called `rustup`. |
||||
|
||||
To confirm you have Rust and `cargo` installed, run: |
||||
|
||||
``` |
||||
rustc --version |
||||
cargo --version |
||||
``` |
||||
|
||||
### Rust Versions |
||||
|
||||
`wasm-pack` depends on a library called `wasm-bindgen`. `wasm-bindgen` requires that you use |
||||
Rust 1.30.0 or higher. This version is currently only available on the `nightly` or `beta` |
||||
channels. |
||||
|
||||
To get the correct version of Rust, you'll use `rustup` a Rust version manager that comes |
||||
bundled with Rust. Run this command to install the latest Rust on the `beta` channel: |
||||
|
||||
``` |
||||
rustup install beta |
||||
``` |
||||
|
||||
You can set your project directory to always use this version of Rust by running: |
||||
|
||||
``` |
||||
rustup override set beta |
||||
``` |
Loading…
Reference in new issue