Upgrade your angular CLI global version

Run below commands:

npm uninstall -g angular-cli
npm cache clean
npm install -g @angular/cli@latest 
 
Depending on your system, you may need to prefix the above commands with sudo.
 

Upgrade your local project angular CLI

go to in your project directory:

cd /home/rahul/angular-projects/test

then run below commands:

rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install

Upgrade your npm global version to latest

Run  below command:

sudo npm i -g npm

Upgrade angular 4 project to angular 5

Go to in your project directory:

cd /home/rahul/angular-projects/test-proj

then run below two commands one by one:

npm install @angular/{animations,common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router}@'^5.0.0' typescript@2.4.2 rxjs@'^5.5.2'

npm install typescript@2.4.2 --save-exact

No such file or directory in /opt/lampp/htdocs/wplms/wp-includes/wp-db.php

Correct the DB_HOST entry in wp-config.php like:

define('DB_HOST', 'localhost:/var/lib/mysql/mysql.sock');

The file path of mysql.sock it varies according to your os / setup. So make it correct accordingly.