How to install Strapi v4 with MySQL 8 (part 1)

Tanny Nogales
2 min readDec 11, 2021

Strapi is an headless CMS used for building fast and easily manageable APIs written in JavaScript, which allows you to solve the backend of your application (including de user interface) and focus on what matters.

First we need to install Node and for that we are going to use NVM, which is a Node Version Manager that allows you have multiple node versions installed at you computer and switch depending what you need, what is specialist useful considering that Strapi just work with Node 14.

You can find the install instructions at the oficial site of NVM:

  1. Run the following code in the terminal:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

2. If you using mac, manually create an empty ~/.zshrc file, and then add these lines to it:

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Note: to find .zshrc use “open ~” in the terminal and then use “[cmd] + [shift] + [.]” to see hidden files.

3. Check if NVM is correctly installed: close the terminal and type the following code:

nvm ls

You should see something like this:

v14.18.2-> v17.2.0default -> node (-> v17.2.0)

How you can see, I have installed two Node versions and v17 is the default one.

4. To download, compile, and install the latest release of node, do this: (the first Node version installed becomes the default)

nvm install node

5. Install the latest LTS Node 14 versions:

nvm install 14.18.2

Note: using nvm ls-remote you can list all the available Node versions.

6. And then in any new shell just use the installed default version:

node --v #v17.2.0

Or change the Node version has you need:

nvm use 14.18.2

In the next post we will install MySQL an Strapi.

--

--