you can find the exact NodeJS version recommended use for every Moodle branch @ the .nvmrc file.
Right now it's node v14.0.0 and if you use nvm it's really easy to keep it maintained. It comes with npm 6.14.4, although that's not important.
Just ensure you're using the correct node, and surely you'll be using the correct npm (specially if using nvm, or another node versions manager).
PS: Note that, from time to time, we use to bump versions, so maybe current node v14.0.0 will become v14.9.0 or so (in fact surely everything works ok with that one as far as changes within the same release are minimum). In any case, both the docs (link above and other pages too) and also the commented
.nvmrc files... will give you the answer.