Frontend Development Environment Setup
Introduction
Setting up the frontend development environment requires several steps and careful configuration. This guide will walk you through each stage to ensure a smooth setup process.
IDE Selection
Recommended IDEs
We recommend two primary Integrated Development Environments (IDEs):
-
WebStorm (Preferred)
- Free for development
- Excellent JavaScript and React support
- Advanced code intelligence features
-
Visual Studio Code
- Already covered in the Middleman Setup Guide
- Lightweight and extensible
- Large community and plugin ecosystem
Whichever IDE you choose, ensure you have JavaScript and React development extensions installed.
Node.js Installation
Node.js is crucial for frontend development, providing the runtime environment for JavaScript.
Windows Installation
-
Visit Node.js Official Website
-
Download version 22.11 or higher
-
Run the installer
-
Check installation via Command Prompt:
node --version
npm --version
macOS Installation
Method 1: Direct Download
-
Visit Node.js Official Website
-
Download version 22.11 or higher
-
Open the .pkg file and follow the installation wizard
Method 2: Homebrew (Recommended)
# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node.js version 22.11 or higher
brew install node@22
Linux (Ubuntu/Debian) Installation
# Add NodeSource repository for Node.js 22.x
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
# Install Node.js and npm
sudo apt-get install -y nodejs
# Verify installation
node --version
npm --version
-
Minimum Required Version: Node.js 22.11
-
Why version 22.11+?
-
Latest performance improvements
-
Enhanced security features
-
Better ECMAScript compatibility
-
Improved module and package management
-
Node Version Management
Consider using nvm (Node Version Manager) for easier version switching:
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# Install latest LTS Node.js version
nvm install --lts
NPX Installation
NPX comes bundled with npm (Node Package Manager) version 5.2.0 and higher.
Verification
# Check npx installation
npx --version
NPX allows you to execute npm package binaries without globally installing them. It's particularly useful for running one-off commands or trying out packages.
Repository Cloning
Frontend Repository Setup
# Create frontend base path
mkdir -p $FRONTEND_BASE_PATH$
# Navigate to the directory
cd $FRONTEND_BASE_PATH$
# Clone the frontend repository
git clone https://github.com/TravellingLanguages/frontend.git
# Enter the project directory
cd frontend
Initial Project Setup
# Install project dependencies
npm install --force
# Start development server
npm run start
Troubleshooting
Common Installation Issues
- Permission Errors: Use
sudocautiously or configure npm to work without sudo - Version Conflicts: Use Node Version Manager (nvm) to manage multiple Node.js versions
- Dependency Problems: Always run
npm installin the project root
- Always download Node.js from the official website
- Keep your Node.js and npm versions updated
- Be cautious when installing global packages
Next Steps
After completing these steps, you'll have a fully configured frontend development environment ready for coding!
Recommended Learning Path
- Familiarize yourself with the project structure
- Review the project's README
- Check out the contributing guidelines
Additional Resources
- Official Node.js Documentation
- NPM Documentation
- React Documentation
- WebStorm Documentation
- Next.js Documentation
Happy Coding! 🚀