Specified module 'app' does not exist. Looked in the following directories: /src/app/book /src/app/app /src/app /src
- Exception message and full stack trace:
- Steps to reproduce the issue:
- Create new solution via Abp Studio 1.2.2
yarn ng generate module author --module app --routing --route authors
(Tutorial)
2 Answer(s)
-
0
The error "Specified module 'app' does not exist" occurs because the Angular CLI cannot find a module named
app
when you use the--module app
option. In Angular, the--module
option expects the name of an existing module file (e.g.,app.module.ts
), not justapp
.Solution
- Use the Correct Module Path
- Instead of
--module app
, specify the full path to your root module file, usuallyapp.module.ts
:
- Instead of
yarn ng generate module author --module src/app/app.module.ts --routing --route authors
- This tells Angular CLI to import the new module into
src/app/app.module.ts
.
Verify Module File Exists
- Ensure that
src/app/app.module.ts
exists in your project. If your main module has a different name or location, adjust the path accordingly.
- Ensure that
Reference from Official Tutorial
- The official ABP Book Store tutorial uses the following command:
yarn ng generate module author --module app --routing --route authors
- However, if your project structure is different or the CLI cannot resolve
app
, always use the explicit path as shown above.
Example
yarn ng generate module author --module src/app/app.module.ts --routing --route authors
This will correctly generate the
author
module and update yourapp.module.ts
with the new import.
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
- Use the Correct Module Path
-
0
Hi,
The app.module.ts file does not exist, it was not created by abp studio