Brew - Node@8 with npm v5
Easier than messing up with Homebrew is to use asdf package manager. With that you can have multiple version of Node.js (as well as many other development tools) installed and configured running different versions in different directories. It looks like you can have it installed using Homebrew:

$ brew install asdf


Then you can install Node.js plugin using

$ asdf plugin-add nodejs


You can list versions of available Node.js versions by

$ asdf list-all nodejs


and choose the desirable versions to install, e.g.

$ asdf install nodejs 8.17.0
$ asdf install nodejs 14.4.0


You need to have asdf in your $PATH before anything else; I am not sure where these are if using Homebrew installed asdf, but Homebrew should tell you how to configure your shell profiles during installation.

You can activate a version of Node.js (and associated NPM) as a global default by

$ asdf global nodejs 14.4.0


or locally in the given directory (and subdirectories) with

$ asdf local nodejs 8.17.0


(which will just write .tools file in the directory specifying the desired version).

Each of the Node.js environment have their own global packets.