bradtraversy / meanauthapp

Complete MEAN stack app with authentication
242 stars 152 forks source link

ng serve not working #31

Open CaolanMcB96 opened 6 years ago

CaolanMcB96 commented 6 years ago

When trying to server my angular application i get the following error.

ERROR in multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts Module not found: Error: Can't resolve 'webpack-dev-server/client?http://0.0.0.0:0' in 'C:\Users\Caolan\FingerprintProject\angular-src' ERROR in Error: No NgModule metadata found for 'AppModule'. at NgModuleResolver.resolve (C:\Users\Caolan\FingerprintProject\angular-src\node_modules\@angular\compiler\bundles\compiler.umd.js:20285:23) at CompileMetadataResolver.getNgModuleMetadata (C:\Users\Caolan\FingerprintProject\angular-src\node_modules\@angular\compiler\bundles\compiler.umd.js:15238:60) at visitLazyRoute (C:\Users\Caolan\FingerprintProject\angular-src\node_modules\@angular\compiler\bundles\compiler.umd.js:31176:104) at AotCompiler.listLazyRoutes (C:\Users\Caolan\FingerprintProject\angular-src\node_modules\@angular\compiler\bundles\compiler.umd.js:31144:20) at AngularCompilerProgram.listLazyRoutes (C:\Users\Caolan\FingerprintProject\angular-src\node_modules\@angular\compiler-cli\src\transformers\program.js:156:30) at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\Users\Caolan\FingerprintProject\angular-src\node_modules\@angular\compiler-cli\src\ngtools_api.js:44:36) at AngularCompilerPlugin._getLazyRoutesFromNgtools (C:\Users\Caolan\FingerprintProject\angular-src\node_modules\@angular\cli\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:263:66) at Promise.resolve.then.then (C:\Users\Caolan\FingerprintProject\angular-src\node_modules\@angular\cli\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:586:50) at at process._tickCallback (internal/process/next_tick.js:188:7) -->

Versions



### Repro steps
<!--
CD into my angular-src path
-->
The node.js server is running on port 3000 and is connected to MongoDB in port 27017
when i try to server my application the error as shown above appears

Even when i use the "ng new "name"" command it will not create a new angular project folder

![angular error](https://user-images.githubusercontent.com/33484891/36530753-d41ebd04-17b3-11e8-8afe-35cf1831b3f1.PNG)
kasparov112000 commented 6 years ago

try to do a fresh clone, npm install and npm start...that worked for me

tomcatbuzz commented 6 years ago

@CaolanMcB96 you need to CD into the Angular/src and run npm install to install the Angular and dependencies. The backend is the root project and you do npm install from that folder also. Running ng new is only used for a new project.