This guide will help you set up your development environment and make your first contribution to the Node.js website.
- Prerequisites
- Setting Up Your Development Environment
- Making Your First Contribution
- Available CLI Commands
- Next Steps
- Getting Help
- Node.js (latest LTS version recommended)
- pnpm package manager
- Git
- A GitHub account
-
Fork and Clone the Repository
Click the fork button in the top right to clone the Node.js Website Repository
git clone git@github.com:<YOUR_GITHUB_USERNAME>/nodejs.org.git # SSH git clone https://github.com/<YOUR_GITHUB_USERNAME>/nodejs.org.git # HTTPS gh repo clone <YOUR_GITHUB_USERNAME>/nodejs.org # GitHub CLI
-
Navigate to the Project Directory
cd nodejs.org -
Set Up Remote Tracking
git remote add upstream git@github.com:nodejs/nodejs.org.git # SSH git remote add upstream https://github.com/nodejs/nodejs.org.git # HTTPS gh repo sync nodejs/nodejs.org # GitHub CLI
-
Install Dependencies
pnpm install --frozen-lockfile
-
Start the Development Server
pnpm dev # starts a development environment at http://localhost:3000/
-
Create a New Branch
git checkout -b name-of-your-branch
-
Make Your Changes
- For repository structure guidance, see Technologies
- For adding new pages, see Adding Pages
- For component development, see Creating Components
-
Test Your Changes
pnpm format # runs linting and formatting pnpm test # runs all tests
-
Keep Your Branch Updated
git fetch upstream git merge upstream/main
-
Commit and Push Your Changes
git add . git commit -m "describe your changes" git push -u origin name-of-your-branch
[!TIP] Follow our commit guidelines for commit message format.
-
Create a Pull Request
- Go to your fork on GitHub
- Click "New Pull Request"
- Follow our pull request guidelines
pnpm dev- Start local development serverpnpm build- Build for production (Vercel deployments)pnpm deploy- Build for export (Legacy server)pnpm start- Start server with built content
pnpm lint- Run linter for all filespnpm lint:fix- Attempt to fix linting errorspnpm prettier- Run prettier for JavaScript filespnpm prettier:fix- Attempt to fix style errorspnpm format- Format and fix lints for entire codebase
pnpm test- Run all tests locallypnpm test:unit- Run unit tests onlypnpm test:ci- Run tests with CI output format
pnpm scripts:release-post -- --version=vXX.X.X --force- Generate release postpnpm storybook- Start Storybook development serverpnpm storybook:build- Build Storybook for publishing
- Read about our code style guidelines
- Learn about creating components
- Understand our testing practices
- Review the technologies we use
- Open a Discussion for questions
- Check existing Issues for known problems
- Review our Code of Conduct