How to upgrade your version of NPM and Nodejs on Ubuntu 16.04?
When installed via apt-get:
sudo apt-get install npm
sudo apt-get install nodejs
He installed only the old version:
$ nodejs -v
Then when you install angular POPs up here this error:
$ npm install -g @angular/cli
npm ERR! Linux 4.10.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "@angular/cli"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ECONNRESET
npm ERR! network tunneling socket could not be established, cause=write EPROTO
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'