Source File Not Found in Angular CLI project

后端 未结 11 1467
臣服心动
臣服心动 2021-01-03 17:50

Hi I have this folders in my project But When I run I get this error

Any idea please?

regards

11条回答
  •  情歌与酒
    2021-01-03 18:26

    Thanks to @Hisham Afzal Ahamed for the solution (stopping and re-starting the Angular compiler).

    • Stop the compiler: CTRL-C, CTRL-C (or CTRL-C then Y)
    • Restart: ng serve (or whatever else you're using e.g. a custom npm script)

    Basically the Angular CLI sometimes doesn’t ‘see’ files that have been pulled in (e.g. when doing a merge while your compiler is running). Very useful to know. As a general time saver, If you’re pulling files into your solution or doing something similar, or you get an Angular compiler error that makes no sense, or you've made significant changes somehow, it’s always worth stopping then restarting the compiler to do a fresh build - it can save so many headaches!

提交回复
热议问题