Issue
I have following versions currently installed
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
Since I was not able to update anguler-cli (ng update), I tried uninstalling it using
sudo npm uninstall -g angular-cli
sudo npm uninstall -g @angular/cli
sudo npm cache clean --force
sudo npm cache verify --force
All of these commands reported no issues and appear to have executed just fine. However, if I issue ng version after issuing these commands, I still get my old versions like shown above.
None of the answers on Stackoverflow on google helped, I read probably 50 of them.
Attempt to update also fails with
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.
I am not inside any project folder so I dont understand why does it complain about node_modules directory or package lock file.
I am on Mac BigSur.
Solution
None of the posts I found worked no matter what I did. And Angular github was useless like in most cases.
Eventually, I have up on uninstalling or updating Angular CLI as none of solutions I found worked. I instead decided to uninstal node from my Mac and reinstall it.
To completely uninstall node, I followed this post https://www.positronx.io/how-to-uninstall-node-js-and-npm-from-macos/
Once I uninstalled node, ng version no longer was reporting any angular so all good. Then I downloaded latest node and installed it on my Mac. After this I simply issued command to install angular like:
sudo npm install -g @angular/cli
After this, my Angular was on version 13.x
Answered By - cd491415
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.