Prerequisites
Before you can use rust-wasmpack-loader, you need to set up your development environment with the required tools and dependencies.
System Requirementsβ
Operating Systemsβ
- Windows 10/11 (x64)
- macOS 10.15+ (Intel/Apple Silicon)
- Linux (Ubuntu 18.04+, CentOS 7+, or equivalent)
Hardware Requirementsβ
- RAM: 4GB minimum, 8GB recommended
- Storage: 2GB free space for tools and dependencies
- CPU: Any modern x64 or ARM64 processor
Version Compatibilityβ
Tool | Minimum Version | Recommended |
---|---|---|
Node.js | 18.0.0 | 20.x.x |
Rust | 1.30.0 | >1.85.0 |
npm | 10.0.0 | Latest |
Required Softwareβ
1. Node.jsβ
rust-wasmpack-loader requires Node.js version 18.0.0 or higher.
Best Practice
We recommend using Volta for managing Node.js versions. Volta helps ensure consistent Node.js environments across development and CI/CD systems.
Installationβ
- Windows
- macOS
- Linux
# Using Volta (recommended)
curl https://get.volta.sh | bash
volta install node@20
# 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@20
# Using Homebrew
brew install node
# Using MacPorts
sudo port install nodejs20
# Or download from https://nodejs.org/
All distributions:
# Using Volta (recommended)
curl https://get.volta.sh | bash
volta install node@20
Ubuntu/Debian:
# Using NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_20.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_20.x | sudo bash -
sudo yum install -y nodejs npm
Verify Installationβ
node --version # Should show v20.0.0 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 is required to compile your .rs
files to WebAssembly.
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.30.0 or higher
cargo --version # Should show 1.30.0 or higher
Environment Ready! β
Your development environment is now configured for Rust-WebAssembly development with rust-wasmpack-loader!