首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法从Mac卸载或更新角CLI

无法从Mac卸载或更新角CLI
EN

Stack Overflow用户
提问于 2022-02-15 03:58:29
回答 1查看 508关注 0票数 2

我现在已经安装了以下版本

代码语言:javascript
复制
Angular CLI: 9.1.9
Node: 17.4.0
OS: darwin x64

Angular: 
... 
Ivy Workspace: 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.901.9
@angular-devkit/core         9.1.9
@angular-devkit/schematics   9.1.9
@schematics/angular          9.1.9
@schematics/update           0.901.9
rxjs                         6.5.4

由于我无法更新anguler-cli (ng更新),所以我尝试使用

代码语言:javascript
复制
sudo npm uninstall -g angular-cli
sudo npm uninstall -g @angular/cli
sudo npm cache clean --force
sudo npm cache verify --force

所有这些命令都没有报告任何问题,并且似乎执行得很好。但是,如果在发出这些命令后发出ng version,我仍然会得到上面所示的旧版本。

谷歌上的Stackoverflow没有一个答案有帮助,我看了其中大概50个。

更新的尝试也失败了

代码语言:javascript
复制
sudo ng update

The "@angular-devkit/schematics" package cannot be resolved from the workspace root directory. This may be due to an unsupported node modules structure.
Please remove both the "node_modules" directory and the package lock file; and then reinstall.
If this does not correct the problem, please temporarily install the "@angular-devkit/schematics" package within the workspace. It can be removed once the update is complete.

我不在任何项目文件夹中,所以我不明白为什么它会抱怨node_modules目录或包锁文件。

我在麦克BigSur上。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-02-19 00:46:19

不管我做了什么,我发现的职位都没有起作用。棱角的github在大多数情况下都是无用的。

最后,我已经卸载或更新角CLI,因为我发现没有一个解决方案有效。相反,我决定从我的Mac中卸载节点并重新安装它。

为了完全卸载节点,我遵循了下面的文章https://www.positronx.io/how-to-uninstall-node-js-and-npm-from-macos/

一旦我卸载节点,ng version不再报告任何角度,所以一切都很好。然后我下载了最新的节点并将其安装在我的Mac上。在此之后,我只需发出命令来安装转角,比如:

代码语言:javascript
复制
sudo npm install -g @angular/cli

在这之后,我的角度在13.x版上

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71120964

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档