on update angular code example
Example 1: ng update @angular/core @angular/cli
npm uninstall -g angular-cli
npm install -g @angular/cli@latest
Example 2: angular update
npm uninstall -g @angular-cli
npm cache verify
npm install -g @angular/cli@latest
Example 3: update angular
npm uninstall -g @angular-cli
npm install -g @angular/cli@latest
Example 4: ng update @angular/core @angular/cli
rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install