Node & NPM
Step 1: Check Node.js and npm Versions
Before setting up the local installation of our WordPress site, it’s important to ensure you have the correct versions of Node.js and npm installed.
-
Open your terminal (Command Prompt, Git Bash, or any terminal emulator you’re comfortable with).
- Check the Node.js version:
- Run the following command to check your Node.js version:
node -v
- You should see an output that looks something like this:
v14.x.x
- Ensure that your version is v14.x.x or higher. If not, you may need to update Node.js.
- Run the following command to check your Node.js version:
- Check the npm version:
- Run the following command to check your npm version:
npm -v
- You should see an output like:
6.x.x
- Ensure that your version is 6.x.x or higher. If not, you may need to update npm.
- Run the following command to check your npm version:
Step 2: Updating Node.js and npm (if necessary)
If you need to update Node.js or npm, follow these steps:
- For macOS/Linux users: Use a version manager like nvm (Node Version Manager).
- Install nvm if you don’t have it installed:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
- Install the latest LTS (Long Term Support) version of Node.js:
nvm install --lts
- Set it as the default version:
nvm use --lts nvm alias default node
- Install nvm if you don’t have it installed:
-
For Windows users: Use the Node.js installer to download and install the latest version.
- Verify the installation: After updating, run
node -v
andnpm -v
again to ensure the versions are correct.