Run the WP Rig installer

Getting the build process and code linting up and running requires installing all of WP Rig’s Node and Composer dependencies. This is done from the command line.

In VS Code, there is a built-in terminal, and you can open it either by hitting CONTROL + backtick on your keyboard both on Windows and Mac OS, or go to the Application menu, select View, and either Terminal on Windows or Integrated Terminal on Mac OS.

If VS Code is open to the WP Rig folder, you are now navigated directly to that folder in terminal and you’re ready to go.

From here, you can now run one of two commands: either

  • npm run rig-init – This installs both Node and Composer dependencies.
  • OR, if you already have your Composer dependencies installed, you can also run just npm install.

It’s important to note the difference here. If you already installed WP Rig in this folder, you’ve worked with it, and you just want to update your Node dependencies, then you run npm install.

But if this is your first setup of WP Rig, new project, you just set it up, just configured it, and everything is ready to go, say npm run rig-init. Now your computer will go onto the internet, find every single dependency for both Node and Composer, pull it all down into your project. And notice I execute this command on my computer, downloading all these dependencies can take some time depending on your internet connection and available processing power, so this might be a good time to hit pause and take a short break.

When the install process in the terminal is complete, you’ll see two new folders inside your WP Rig folder: node_modules, which holds all the Node dependencies and vendor, which holds all the Composer dependencies.

The cool thing is, none of these require any configuration on your part, but they’re necessary for WP Rig to work properly. Oh and one more thing, if you get an error during this process, it’ll be very obvious, it’ll be lots of red text inside the terminal, it’s probably because you don’t have Composer installed.

Almost all the errors I see in the install process is because of Composer not being on the computer in the first place. If you’re unsure if you have Composer installed, it’s really easy to check. Just go to your terminal and type in composer -v. If Composer is installed, you’ll get a message that gives you information about Composer, its version number, and what you can do with it.

If it’s not working and you get an error, it means you need to install Composer and then go back and run npm run rig-init again to get everything installed. The good news is, you can run npm run rig-init as many times as you like, it’ll just keep reinstalling the same stuff on top of the existing folders. So you’ll never run into a risk here of double installing anything.

More from this course: