19 Years of Excellence 99% Hiring Rate

Error in Angular – ENOENT: no such file or directory, lstat

ADMEC Multimedia Institute > Web Design > Error in Angular – ENOENT: no such file or directory, lstat

Angular is an awesome framework of JavaScript which is based on TypeScript that is a superset of it. TypeScript enables programmers to write JavaScript in true object oriented way. We use npm or Node Package Manager which compiles TypeScript to JavaScript.

When you compile your Angular app and suddenly your cmd screen is filled with the following error then what you should do!

ENOENT: no such file or directory, lstat 'F:\D\Classes\Angular\09 Components Databinding Deep Dive-II\cmp-databinding-final\node_modules'

Error: ENOENT: no such file or directory, lstat 'F:\D\Classes\Angular\09 Components Databinding Deep Dive-II\cmp-databinding-final\node_modules' at Error (native) at Object.fs.lstatSync (fs.js:982:18) at Object.realpathSync (fs.js:1662:21) at Object.getBrowserConfig (F:\D\Classes\Angular\node_modules\@angular\cli\models\webpack-configs\browser.js:24:36) at NgCliWebpackConfig.buildConfig (F:\D\Classes\Angular\node_modules\@angular\cli\models\webpack-config.js:31:77) at Class.run (F:\D\Classes\Angular\node_modules\@angular\cli\tasks\serve.js:71:98) at check_port_1.checkPort.then.port (F:\D\Classes\Angular\node_modules\@angular\cli\commands\serve.js:123:26) at process._tickCallback internal/process/next_tick.js:103:7)

Solution

There is no particular solution for this error all the time because this error you may face at many situation and here I am explaining only one of the common one. Actually when we work on multiple Angular Apps and want to keep our development hassle free and light weight then we keep node_modules directory at a common place and we access all the modules from there in all the apps.

I hope you have already done it in your past. If you never did it then let me know in comments; I will explain the process. So, when we try to do so, then we have to keep a empty folder (node_modules) in our each project too else you will get this error.

Hope it helps you.

Thanks

Related Posts

Talk to Us