I've tried several times to uninstall my angular-cli in order to update it but even if I follow the instructions provided on github:

  • npm uninstall -g @angular/cli
  • npm cache clean
  • npm install -g @angular/cli@latest

When I check using the command ng --version I still get the old version :

 angular-cli: 1.0.0-beta.26

 node: 7.7.1
 os: darwin x64

How can i fix this issue? Thanks

推荐答案

If you are facing issue with angular/cli then use the following commands:
npm uninstall -g angular-cli to uninstall the angular/cli.
npm cache clean to clean your npm cache from app data folder under your username.
use npm cache verify to verify your cache whether it is corrupted or not.
use npm cache verify --force to clean your entire cache from your system.

Note:
You can also delete by the following the paths
C:\Users\"Your_syste_User_name"\AppData\Roaming\npm and
C:\Users\"Your_syste_User_name"\AppData\Roaming\npm-cache
Then use the following command to install latest angular/cli version globally in your system.
npm install -g @angular/cli@latest
To get more information visit github angular-cli update.

Angular相关问答推荐

我使用Ngrx的子集 Select 器不起作用

将kendo—colorpicker的kendo弹出窗口附加到组件''

Angular 17@在大小写时切换多个值

Toastr在独立组件上的Angular17实现

仅在从forkJoin获得数据后订阅主题

判断哪个Angular 信号导致了影响

在剑道UI网格中包装Excel导出的列

HTTP拦截器在Angular 17项目中不起作用

如何解决在StackBlitz中使用SPARTIER时出现无法解析解析器错误(&C)?

Angular 单位测试表

Angular AuthGuard:不推荐使用 CanActivate 和 CanActivateChild.如何更换它们?

在更改检测之前调用创建的间谍

Angular 2 二传手与 ngOnChanges

在 Angular2 中跟踪 Google Analytics 页面浏览量

CORS 错误:requests are only supported for protocol schemes: http…等

ERROR 错误:StaticInjectorError(AppModule)[UserformService -> HttpClient]:

unexpected token < 错误

Angular 应用程序中的语法错误:Unexpected token <

Angular 2:将外部js文件导入组件

如何在 Angular 中使用带有 SASS 的 Bootstrap 4