Errors began after updating to Angular-Cli V10.1.0.
Initial problems I encountered:
The ng command was not working. I found that core dependencies were missing:
npm WARN @angular/[email protected] requires a peer of @angular/common@^9.0.0 but none is installed. You must install peer dependencies yourself.
I Tried:
Installing dependencies manually.
Uninstalling the angular-cli globally, clearing the cache with --force, rebooting and reinstalling.
Downloading latest NodeJs, updating npm usingnpm update as well as Angular: ng update.
Using PowerShell in admin mode to run chkdsk /f worked for me.
I also had to restart my PC.
Then SHIFT + DEL the node_modules directory.
Worked like a piece of cake!
0
Eric S
On
I think if you are able to successfully delete your entire node_modules folder a simple npm install will fix your issue.
Close all programs that could possible touching the file and attempt to delete it.
Attempt to delete it using the cmd line. If you are not already I suggest you use a cmd prompt like Cmder which will give you some of the linux cmd prompt tools in windows. Then try rm -rf node_modules from the correct directory.
If both of those don't work restart your computer, and attempt 1 & 2 again.
If none of those work boot into safe mode and once again attempt to remove the files.
You can go down a further rabbit hole to figure out how to delete that file but if you are in a time crunch you could just copy your entire project (minus the node_modules) to a new folder. Delete the package.lock.json and then npm install
EUREKA - Problem Solved!
Steps I took which fixed the issue:
Powershell
as administratorchkdsk /f
node_modules
npm install