Skip to content

Cannot run ng serve in Angular 5.2 #9174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vinhloc1996 opened this issue Jan 12, 2018 · 3 comments
Closed

Cannot run ng serve in Angular 5.2 #9174

vinhloc1996 opened this issue Jan 12, 2018 · 3 comments

Comments

@vinhloc1996
Copy link

Versions

Angular CLI: 1.6.4
Node: 8.9.3
OS: win32 x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.4
@angular-devkit/build-optimizer: 0.0.37
@angular-devkit/core: 0.0.24
@angular-devkit/schematics: 0.0.45
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.12
typescript: 2.5.3
webpack: 3.10.0

Node Versions

v8.9.3

NPM Versions

5.6.0

Repro steps

  • Step 1
    Install Angular with: npm install -g @angular/cli
  • Step 2
    Create a new app with: ng new Dating.SPA
  • Step 3
    Navigate to the app folder: cd Dating.SPA
  • Step 4
    Run application with: ng serve

Observed behavior

ERROR in Error: Could not resolve module D:/C
    at StaticSymbolResolver.getSymbolByModule (D:\C#\Practices\Udemy Courses\Dating.SPA\node_modules\@angular\compiler\bundles\compiler.umd.js:29757:30)
    at StaticReflector.resolveExternalReference (D:\C#\Practices\Udemy Courses\Dating.SPA\node_modules\@angular\compiler\bundles\compiler.umd.js:31594:62)
    at parseLazyRoute (D:\C#\Practices\Udemy Courses\Dating.SPA\node_modules\@angular\compiler\bundles\compiler.umd.js:29043:55)
    at AotCompiler.listLazyRoutes (D:\C#\Practices\Udemy Courses\Dating.SPA\node_modules\@angular\compiler\bundles\compiler.umd.js:31134:43)
    at AngularCompilerProgram.listLazyRoutes (D:\C#\Practices\Udemy Courses\Dating.SPA\node_modules\@angular\compiler-cli\src\transformers\program.js:156:30)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (D:\C#\Practices\Udemy Courses\Dating.SPA\node_modules\@angular\compiler-cli\src\ngtools_api.js:44:36)
    at AngularCompilerPlugin._getLazyRoutesFromNgtools (D:\C#\Practices\Udemy Courses\Dating.SPA\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:248:66)
    at Promise.resolve.then.then (D:\C#\Practices\Udemy Courses\Dating.SPA\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:565:50)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

webpack: Failed to compile.

Desired behavior

This is the first time I try the angular app, I was thinking it should be easy to create and run new demo app. But the errors cannot give me any clues to solve my problem, so I'm posting here to ask if I wrong somewhere one creating and running it. I deleted the node_modules folder and run npm install but still not solve it.

@vinhloc1996
Copy link
Author

I think I found the issue. It looks like the angular app cannot run on the special character path, in my case is # in C#. I don't know it is a bug or not because in Windows, # is a valid character for the path.

@DanielMescoloto
Copy link

Thank you!
I have a folder named "#8 - Projects" and the angular could not run.
I know It's not recommended to use special character on folders name, but I didn't have problems with that. Always typing "#8 - Projects"/_project_name/etc

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants