update angular cli

JavaScript
npm update @angular/cli -gnpm uninstall -g angular-cli
npm install -g @angular/cli@latest
npm install -g @angular/cli
ng new my-dream-app
cd my-dream-app
ng serveFor updating angular cli type this command :
ng update @angular/cli @angular/core   npm uninstall -g @angular-cli
npm install -g @angular/cli@latest
For updating angular cli type this command :
ng update @angular/cli @angular/core 
Source

Also in JavaScript: