Don’t forget to save any new path commands into .zshrc so the terminal session persists.
- Open the Terminal app
- Install homebrew
- You might be asked if you want to install the Xcode Command Line Tools, confirm.
- Install git by typing
brew install git
- Install Docker on Apple Silicon
- Install node via
brew install node@16
orbrew install node@18
, your preference.- I install node via nvm, but it’s not necessary
- Install Node by using nvm ( I use node 16.x at the moment )
- Open a terminal session
brew install nvm
- Run
nvm install 16
- Run
nvm use 16
- Run
nvm alias default 16
, so every shell session uses this version of node by default
- Install npm via
brew install npm@6
- Switch to npm v6.x via
npm install npm@6 -g
- Make sure you copy path commands to your .zshrc file
- Switch to npm v6.x via
- Clone the GitHub repository with the wordpress-develop environment.
- Open a terminal session
cd ~
git clone https://github.com/WordPress/wordpress-develop.git
cd ./wordpress-develop
export DOCKER_DEFAULT_PLATFORM=linux/amd64
- Open the Docker app in your computer and ignore the welcome screen that tells you to create a container
- Now type these commands in the terminal
npm install
npm run build:dev
npm run env:start
npm run env:install
- You should be able to access the development version of WordPress at localhost:8889. You can access it with username admin and password password
- Additional commands
–npm run env:stop
–npm run env:reset
Shortcuts
Initialize
- Open a terminal session
cd ./wordpress-develop
export DOCKER_DEFAULT_PLATFORM=linux/amd64
- Open Docker.app
rm -rf node_modules && npm install && npm run build:dev && npm run env:start
npm run env:install
May need to re-run npm run env:install
if it stalls or errors at end. This is because MySQL may not be ready yet.
Cleanup
npm run env:stop && npm run env:reset && rm -rf node_modules
- Quit Docker Desktop when done.
Run individual tests
npm run test:php -- --filter Tests_Admin_IncludesWpUpgrader
- npm run test:php — –group admin
Don’t commit package-lock.json
with your PR to core or you will have issues.