0
votes

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

2

2 Answers

2
votes

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

0
votes

Make sure to run npm install to install all the required dependencies.

EDIT: Looking at your screenshots, It seems that for some reason, your application is looking for the node_modules directory at the wrong place when you run ng serve:

It should be in C:\Users\nitrathod\Desktop\Angular\outlook\node_modules, yet your application is looking into C:\Users\nitrathod\Desktop\Angular\node_modules, which is a wrong place.