To install NPM & Node simply go to the Node web site and install the latest stable version from the downloads page; or use the link on the Node homepage.
To check the installation simply use the methods described below to check the respective versions of NPM & Node.
NPM
NPM stands for Node Package Manager and is a way to quick install packages for Node with all their dependencies.
To check your installed version of NPM from the terminal use:
npm -v
If you use NPM regularly you’ll get nudged occasionally to upgrade – if you see something similar to the following in your CLI, just follow the instructions:

If you need to update your version of NPM and you get errors with the above command, use the following to escalate your privileges:
sudo npm install -g npm stable
Afterwards, check your installed version:

Node
Node is basically JavaScript running on the backend of your server – it can easily replace other more traditional backend languages such as PHP and Java meaning you can use JavaScript for your full stack.
To check your installed version of Node from the terminal use:
node -v
To upgrade Node, simply use NPM with the following command:
Removing NPM & Node from MacOS X
To remove both NPM & Node from your Mac, use the following commands:
cd /usr/local/lib
sudo rm -rf ./node*
cd /usr/local/include
sudo rm -rf ./node*
cd /usr/local/bin
sudo rm -rf ./npm
sudo rm -rf ./node
cd ~
rm -rf ./.npm
You can check to see if your NPM & Node installs return anything using the version command:
node -v
If there are any other areas of NPM or Node that require removal, let me know in the comments.