Could not find an NgModule. Use the skip-import option to skip importing in NgModule. [ERROR] Could not generate page

I start a new app and I tried to generate a new page. and I couldn’t because the following error is showing

Could not find an NgModule. Use the skip-import option to skip importing in NgModule.
[ERROR] Could not generate page.
1 Like

Finally found a solution

I had to go to src/app and run the command.


ionic generate page pages/first

then It worked as before

1 Like

Thank you for this solution
When I do this, it get the new folder in the main of the folder, not in the subfolders src/app

I need to enter src/app/name to create the page name in the right folder

Ionic version
6.11.1

2 Likes

use ng g c my-test/paper and import this component in module

yeah I’m also having the same issue due to this new version. But routing was generating fine.

Hi, can you explain little bit more?

it is a bug in the current version of the ionic logo and must be corrected.

this should work by the hour …
ionic g page src/app/pages/{name-of-your-page}

Hi, is the bug fixed?

yes update to latest version
npm i @ionic/angular-toolkit@2.3.3 --save-dev

2 Likes

This was a bug in ionic v6. Now it seems to be fixed. :relieved: :relieved: :relieved:

Will let this be in the forum for anyone who is struggling with this issue.

thx. thats its the solution to back to normality :slightly_smiling_face: