-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[1.4.0-beta.2] "more than one module matches" error when it should not #7439
Comments
I got exactly the same issue. (Coincidentally my module is also called shared ;)) @angular/cli: 1.4.0-beta.2 (also tested with beta.1) Reverting to 1.3.1 as a workaround |
I have this issue running @angular/cli 1.4.1 on Windows 10. Has this fix been released? For now I'm reverting to 1.3.2, which works |
I have with @angular/cli 1.4.2 on Windows 8.1 I did just like @m-ghaoui and now works! |
try |
I have component folder and with in that i have different component folder and with in that i have shared folder where i have the shared components like header, menu, etc, so with that if i try to created it is throwing the same error. Do you have any solution for this src-->app --> components -> shared ng g c src\app\components\shared\services |
This is not really a complete solution but you can run |
As the warning says, It's because you have more than one module You can solve it by specifying the name of the module you want to import the component to it. |
i've the same issue, |
Did not you try the way I suggested in the comment above? |
yes, this will work too, but ive created now a new folder for the other modules and import it.. |
@m98 I had same problem with another |
Add manualy a new folder, like app/shared and paste your material.module.ts in it. |
i am using Ubuntu, and following command solves the issue for me As the warning says, It's because you have more than one module |
Is there some way to set a default module we want to generate components to? Some option in a config? i see the "--module=app.module" option, and I don't have a problem using it. It would just be nice if there was a way to set a default. Because in previous versions, even if there were multiple modules in the root directory, it would still default to app.module. |
I'm on the newest version of angular everything. nothing resolves. first generating services in a module and now generating components. @angular/cdk: 5.0.2 |
ng generate component componentName --module=app.module |
If you are trying to create a shared folder and add your shared components inside it, generate a module inside the shared folder first. (ex: ng g m shared) |
I got this issue when I created my material module under source/app, generate component couldn't decide between app module or my material module to put the import in to, so it kept giving me this error no matter what the component name was. I moved my material module to src/app/modules and it fixed this issue |
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. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.4.0-beta.2
node: 8.4.0
os: darwin x64
Repro steps.
The log given by the failure.
Desired functionality.
Using 1.3.x the same command adds the component to the root module.
The text was updated successfully, but these errors were encountered: