我现在已经安装了以下版本
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更新),所以我尝试使用
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个。
更新的尝试也失败了
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上。
发布于 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上。在此之后,我只需发出命令来安装转角,比如:
sudo npm install -g @angular/cli在这之后,我的角度在13.x版上
https://stackoverflow.com/questions/71120964
复制相似问题