Unhandled Excelption ENOENT no such file or directory lstat node_modules
I am building an application in Angular 12 which was working fine though, but somehow now it is showing error when I try to run using ng serve. I tried everything by referring various websites for solution but nothing worked. I even deleted the project and cloned it but still it is showing the same error.
Error: An unhandled exception occurred: ENOENT: no such file or directory, lstat 'C:\Project\Project_Name\WebApp\node_modules' See "C:\Users\ASHOKP~1\AppData\Local\Temp\ng-ROVEKJ\angular-errors.log" for further details.
any solution please ?
I've seen this question multiple times, found a rather simple solution that might help in almost all situations. This error is caused due to broken or mismatched dependencies in your angular node-modules package. You can check and resolve this issue using below command.
npm i
This will give you a list of all dependency issues in your angular package with their severity as low, moderate and high.
Using "npm i" would have solved the error, if not you can follow below commands.
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force Thanks for reading.