ng serve is not working even If i updated everything

Ashar Saleem
Ashar Saleem used Ask the Experts™
on
When I hit ng serve on cmd it's not working although its working 1st & 2nd time but its not working now. All things are running perfectly. eg ng --version .. the problem is only with ng serve ..it only runs for the 1st & 2nd time..

Here is the error that cmd geneartes.

 $ ng serve
    ENOENT: no such file or directory, stat 'E:\Work\Angular\Basic website\Angular 4\my-first-app\src\tsconfig.json'
    Error: ENOENT: no such file or directory, stat 'E:\Work\Angular\Basic website\Angular 4\my-first-app\src\tsconfig.json'
        at Error (native)
        at Object.fs.statSync (fs.js:1000:11)
        at AotPlugin._setupOptions (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@ngtools\webpack\src\plugin.js:62:16)
        at new AotPlugin (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@ngtools\webpack\src\plugin.js:27:14)
        at _createAotPlugin (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\models\webpack-configs\typescript.js:55:12)
        at Object.exports.getNonAotConfig (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\models\webpack-configs\typescript.js:71:19)
        at NgCliWebpackConfig.buildConfig (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\models\webpack-config.js:29:37)
        at Class.run (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\tasks\serve.js:43:98)
        at check_port_1.checkPort.then.port (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\commands\serve.js:114:26)
        at process._tickCallback (internal/process/next_tick.js:109:7)

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Looks like cause of problem is clearly stated...

'E:\Work\Angular\Basic website\Angular 4\my-first-app\src\tsconfig.json' file is missing.

If this is a required file + your command (ng serve) was working at some point, then likely the required file has been deleted.

Simply replacing this file or maybe even creating it as an empty file, will allow your command to begin working again.
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Try making a copy of this file
'E:\Work\Angular\Basic website\Angular 4\my-first-app\src\tsconfig.json'

Rename the original to .backup and the new copy to tsconfig.json - do you still have the problem?

Author

Commented:
Now when i added the tsconfig.json file in required path..92 % building is complete & then this error occurs at cmd

ERROR in E:/Work/Angular/Basic website/Angular 4/my-app/src/app/app.component.sp      ec.ts (5,1): Cannot find name 'describe'.
ERROR in E:/Work/Angular/Basic website/Angular 4/my-app/src/app/app.component.sp      ec.ts (6,3): Cannot find name 'beforeEach'.
ERROR in E:/Work/Angular/Basic website/Angular 4/my-app/src/app/app.component.sp      ec.ts (14,3): Cannot find name 'it'.
ERROR in E:/Work/Angular/Basic website/Angular 4/my-app/src/app/app.component.sp      ec.ts (17,5): Cannot find name 'expect'.
ERROR in E:/Work/Angular/Basic website/Angular 4/my-app/src/app/app.component.sp      ec.ts (20,3): Cannot find name 'it'.
ERROR in E:/Work/Angular/Basic website/Angular 4/my-app/src/app/app.component.sp      ec.ts (23,5): Cannot find name 'expect'.
ERROR in E:/Work/Angular/Basic website/Angular 4/my-app/src/app/app.component.sp      ec.ts (26,3): Cannot find name 'it'.
ERROR in E:/Work/Angular/Basic website/Angular 4/my-app/src/app/app.component.sp      ec.ts (30,5): Cannot find name 'expect'.

webpack: Failed to compile.

Open in new window

Author

Commented:
This is the folder structure when i install my-app through
ng new my-app
Screenshot--532-.png
Screenshot--533-.png

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial