Go to "https://nodejs.org/en/" and then download either the latest or most stable versions. After downloading, Mac pkg installer updated the existing version. In linux: apt and windows installer will take care.
When I did the npm -v
from cmd it gave the most stable version which I have downloaded and installed from the above link.
xyz-MacBook-Pro:~ aasdfa$ node -v v8.11.1