-
Notifications
You must be signed in to change notification settings - Fork 12k
ng generate component mymodule/mycomp fails when project root set deep #8653
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
Comments
I had a similar issue in a jHipster generated project but I upgraded Angular CLI from 1.6.0 version to 1.6.1 and it seems to be working fine now. Version 1.6.0
Version 1.6.1
Can you take a look too, @Red-3 ? |
I'm now on version 1.6.2, still no joy...
|
Based upon my findings PRs: |
if You are using Angular 6 then change your current directory to /src/app/ then use ng g c new-component. I think the problem will be resolved, It works for me. |
if "ng" is serving the project ..you can probably get this error also....i canceled ng serve in terminal . and it worked |
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version. If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
The root of the @angular project in
.angular-cli.json
issrc/main/webapp
ng generate component mymodule/mycomp
ng generate component mymodule/mycomp --skip-import
Observed behavior
Step 2
Step 3
Component is created in wrong directory. Full path of component is created in root/app, not at root/app (i.e. path is doubled - see below)
Desired behavior
Component created in the correct location and imported into the project module.
Mention any other details that might be useful (optional)
@angular/core
,@angular/material
and@angular/flex-layout
ng new myproj --source-dir src/main/webapp
and it created the component OK. But this project is too complex to create afresh and port code over.--source-dir
option is not documentedFAO: @hansl
The text was updated successfully, but these errors were encountered: