卸载并安装指定版本Angular CLI
卸载之前的版本
npm uninstall -g @angular/cli
清除缓存,确保卸载干净
npm cache clean
检查是否卸载干净
输入ng version
,若显示command not found则卸载干净
安装指定版本
npm install -g @angular/[email protected]
检查版本号
ng version
npm uninstall -g @angular/cli
npm cache clean
输入ng version
,若显示command not found则卸载干净
npm install -g @angular/[email protected]
ng version