System requirements
Ensure your system meets these minimum requirements before proceeding with installation.
- Node.js version 20.10.0 or higher
- npm version 10.2.3 or higher
- WordPress local development environment
- Docker (optional, for wp-env)
Installation steps
Install Node.js and npm
Download and install Node.js from nodejs.org. This will also install npm, the Node package manager.Verify your installation by running:You should see version numbers matching or exceeding the system requirements above.
Set up a local WordPress environment
You have several options for running WordPress locally:
Option 1: wp-env (recommended)
The@wordpress/env package provides a simple way to set up a local WordPress environment using Docker.Option 2: Traditional local environment
You can also use traditional local development tools like:Install the Gutenberg plugin (optional)
To get the latest features and test bleeding-edge functionality, you can install the Gutenberg plugin:From WordPress admin:
- Navigate to Plugins → Add New in your WordPress dashboard
- Search for “Gutenberg”
- Click “Install Now” and then “Activate”
The Gutenberg plugin is not required for block development. WordPress includes the block editor by default. The plugin provides access to the latest features before they’re merged into WordPress core.
Verify your installation
To verify everything is set up correctly, run the following commands:Development tools
While not required, these tools will enhance your development experience:VS Code
The most popular code editor for JavaScript development with excellent WordPress extensions available.
Browser DevTools
Chrome or Firefox developer tools for debugging JavaScript and inspecting the DOM.
React Developer Tools
Browser extension for debugging React components used throughout the block editor.
Git
Version control system for tracking changes and collaborating with others.
Common setup commands
Here are some common commands you’ll use during development:Troubleshooting
Docker issues with wp-env
Ifwp-env fails to start:
- Ensure Docker Desktop is running
- Check that ports 8888 and 8889 are not in use
- Try
wp-env clean allto reset the environment
Node version conflicts
If you need to manage multiple Node versions, consider using:- nvm (Node Version Manager) for macOS/Linux
- nvm-windows for Windows
Build errors
If you encounter build errors:- Clear your
node_modulesfolder and runnpm installagain - Ensure you’re using the correct Node and npm versions
- Check that all dependencies are properly installed