Coding⏱️ 2 min read📅 2026-05-31

How to Fix: Error: More than one module matches. Use skip-import option to skip importing the component into the closest module

Angular CLI error: More than one module matches. Use skip-import option to resolve the issue.

Quick Answer: Try adding the `skip-import` option when creating the component, e.g., `ng generate component my-component --skip-import`

When you encounter the 'Error: More than one module matches. Use skip-import option to skip importing the component into the closest module' error in Angular CLI, it's essential to first identify the root causes of this issue.

🛑 Root Causes of the Error

  • Conflicting module imports can lead to this error. It occurs when there are multiple modules with the same name or when a module is not properly configured.

🔧 Proven Troubleshooting Steps

Method 1: Clearing Module Cache

  1. Step 1: Run the command `ng delete @angular/core` in your terminal to clear the Angular core module cache.

Method 2: Resolving Conflicting Module Imports

  1. Step 1: Check your module imports and ensure that there are no duplicate or conflicting module imports.

💡 Conclusion

By following these steps, you should be able to resolve the 'Error: More than one module matches. Use skip-import option to skip importing the component into the closest module' error in your Angular CLI project.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions