Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting ENOENT: no such file or directory, lstat 'C:\Users\nitrathod\Desktop\Angular\node_modules' in Angular 11 project

When I am trying to run the angular app below error is displayed.

An unhandled exception occurred: ENOENT: no such file or directory, lstat 'C:\Users\nitrathod\Desktop\Angular\node_modules' See "C:\Users\NITRAT~1\AppData\Local\Temp\ng-kzNmoN\angular-errors.log" for further details.

Error message screenshot

Tried npm install to resolve this issue.

after npm install

Project structure for more clarity. Project sturcture

like image 975
Nitin Rathod Avatar asked Mar 27 '26 04:03

Nitin Rathod


1 Answers

check your angular.json.

I had this problem

    "styles": [
      "src/styles.css",
      "../node_modules/font-awesome/css/font-awesome.css"
    ],

Should have been

    "styles": [
      "src/styles.css",
      "./node_modules/font-awesome/css/font-awesome.css"
    ],

This caused it to look for node_modules in the wrong place

like image 69
Chuck Tung Avatar answered Mar 28 '26 20:03

Chuck Tung



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!