How to downgrade NodeJS version



I am getting this node-pre-gyp error each time I’m installing dependencies for a new repo and that error is just so recent that it is still being discussed over here :

So I have mostly heard from everyone is that NodeJS version should be at 10 instead of latest version 11. This is my first job and first time using a Macbook with MacOS so can someone please guide me on how to do it or any other article which is recent