angular官網升級文檔:https://update.angular.io/#7.0:8.0git
https://angular.cn/guide/schematicsnpm
查看全局的angular/cli版本json
ng versionide
更新全局版本號ui
npm uninstall -g @angular/clispa
ng -v命令行
npm cache clean // 報錯可繼續blog
npm install -g @angular/cli文檔
項目命令行執行get
ng update
對照顯示信息
執行更新 ng update @angular/core
遇到的問題1:
若是顯示錯誤,須要相關依賴的包也得跟着更新,根據系統提示更新其餘額外的包
更新時若是報錯
則須要將本地未提交的代碼git comment
對於須要忽略更新的額外包,能夠直接使用 ng update @angular/core —force
遇到的問題2:
本地若是按照不成功則能夠刪除調package-lock.json 文件後再執行
更新完成後代碼修改參照官網 https://angular.io/guide/static-query-migration