Prerequisites
Before you use rust-wasmpack-loader, set up your environment with the tools below.
System requirementsβ
Operating systemsβ
- Windows 10/11 (x64)
- macOS 10.15+ (Intel or Apple Silicon)
- Linux (Ubuntu 18.04+, CentOS 7+, or equivalent)
Hardwareβ
- RAM: 4GB minimum, 8GB recommended
- Storage: 2GB free for tools and dependencies
- CPU: any modern x64 or ARM64 processor
Version compatibilityβ
| Tool | Minimum Version | Recommended |
|---|---|---|
| Node.js | 22.22.2 | 22.x.x (LTS) |
| Rust | 1.88.0 | latest stable |
| npm | 10.0.0 | Latest |
Required softwareβ
1. Node.jsβ
rust-wasmpack-loader requires Node.js 22.22.2 or higher.
Best Practice
Use Volta to manage Node.js versions. It keeps the Node.js version consistent across development and CI.
Installationβ
- Windows
- macOS
- Linux
# Using Volta (recommended)
curl https://get.volta.sh | bash
volta install node@22
# Using winget
winget install OpenJS.NodeJS
# Using chocolatey
choco install nodejs
# Or download from https://nodejs.org/
# Using Volta (recommended)
curl https://get.volta.sh | bash
volta install node@22
# Using Homebrew
brew install node
# Using MacPorts
sudo port install nodejs22
# Or download from https://nodejs.org/
All distributions:
# Using Volta (recommended)
curl https://get.volta.sh | bash
volta install node@22
Ubuntu/Debian:
# Using NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using snap
sudo snap install node --classic
CentOS/RHEL:
# Using NodeSource repository
curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -
sudo yum install -y nodejs npm
Verify installationβ
node --version # Should show v22.22.2 or higher
npm --version # Should show 10.0.0 or higher
# If using Volta
volta list # Should show the installed Node.js version
2. Rustβ
Rust compiles your .rs files to WebAssembly. The build uses wasm-pack 0.15, which requires Rust 1.88.0 or higher.
Installationβ
- Windows
- macOS
- Linux
# Option 1: Using winget
winget install Rustlang.Rustup
# Option 2: Download from https://rustup.rs/
# Install rustup (Rust installer and version manager)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install rustup (Rust installer and version manager)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Verify installationβ
rustc --version # Should show 1.88.0 or higher
cargo --version # Should show 1.88.0 or higher
tip
Your environment is ready for Rust-WebAssembly development with rust-wasmpack-loader.