Installing Node.js and yurba.js
Setting up your development environment is the first step toward building powerful bots with yurba.js. This guide will walk you through installing Node.js and the yurba.js library on your system.
System Requirements
Before we begin, ensure your system meets these requirements:
- Node.js 20.0.0 or higher (LTS version recommended)
- npm, yarn, pnpm, or bun (package manager)
- Operating System: Windows 10+, macOS 10.15+, or Linux (Ubuntu 18.04+, CentOS 7+)
Installing Node.js
Node.js is the JavaScript runtime that powers yurba.js. You'll need to install it before proceeding with the library installation.
Checking Existing Installation
To verify if Node.js is already installed on your system, open a terminal and run:
node --version
If you see a version number (e.g., v20.10.0
), Node.js is installed. Ensure it's version 20.0.0 or higher.
Windows Installation
Download the Installer
- Visit the official Node.js website
- Download the Windows Installer (.msi) for the LTS version
- Choose the appropriate architecture (x64 for most modern systems)
Run the Installation
- Double-click the downloaded
.msi
file - Follow the installation wizard steps
- Accept the license agreement
- Choose the installation directory (default is recommended)
- Ensure "Add to PATH" is checked
- Double-click the downloaded
Verify Installation
bashnode --version npm --version
Windows Path Issues
If Node.js commands aren't recognized in Windows:
- Open System Properties → Advanced → Environment Variables
- Ensure
C:\Program Files\nodejs\
is in your PATH - Restart your command prompt/PowerShell
macOS Installation
Choose one of these methods:
Option 1: Official Installer
- Download the macOS installer from nodejs.org
- Open the
.pkg
file and follow the installation steps - Verify the installation in Terminal
Option 2: Homebrew (Recommended)
# Install Homebrew if you haven't already
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node.js
brew install node
# Verify installation
node --version
npm --version
Option 3: Node Version Manager (nvm)
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Restart terminal or run:
source ~/.bashrc
# Install latest LTS Node.js
nvm install --lts
nvm use --lts
Linux Installation
Ubuntu/Debian
# Update package index
sudo apt update
# Install Node.js from NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# Verify installation
node --version
npm --version
CentOS/RHEL/Fedora
# Install Node.js from NodeSource repository
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo dnf install -y nodejs npm
# For older systems, use yum instead of dnf
# sudo yum install -y nodejs npm
Arch Linux
# Install Node.js and npm
sudo pacman -S nodejs npm
# Verify installation
node --version
npm --version
Installing yurba.js
Once Node.js is properly installed, you can install yurba.js using your preferred package manager. The library is available on npm and supports all major package managers.
# Install yurba.js
npm install yurba.js
# Install yurba.js
yarn add yurba.js
# Install yurba.js
pnpm add yurba.js
# Install yurba.js
bun add yurba.js
Recommendation
For new projects, we recommend pnpm for its speed and efficiency, or npm for its universal compatibility. The yurba.js project itself uses pnpm.
Installing dotenv
For secure environment variable management, we recommend installing dotenv. This package allows you to load environment variables from a .env
file into process.env
.
npm install dotenv
yarn add dotenv
pnpm add dotenv
# Note: Bun has built-in .env support, but you can still use dotenv if needed
bun add dotenv
Verifying Installation
After installation, verify that yurba.js is properly installed:
Check Package Installation
npm list
pnpm list
yarn list
bun list y
λ ~/Projects/yurbajs/examples/guide-bot main* ❯❯ pnpm list
Legend: production dependency, optional only, dev only
my-bot@0.0.1 /Projects/yurbajs/examples/guide-bot
dependencies:
dotenv 17.2.0
yurba.js 0.1.9
Next Steps
Congratulations! You now have Node.js and yurba.js installed on your system. You're ready to move on to the next step: setting up your bot account.
Additional Resources
- Node.js Documentation - Official Node.js documentation
- npm Documentation - Package manager documentation
- TypeScript Handbook - If you plan to use TypeScript
- Vscodium - Recommended code editor (
Free/Libre Open Source Software Binaries of VS Code
)