I am creating a new page in ionic 5 but it is giving this error **Could not find an NgModule**

1.8k Views Asked by At

When i run ionic g page pages/first

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

And When I run ionic g page src/app/pages/first

it get the new folder in the main of the folder, not in the subfolders src/app like before

I tried to downgrade ionic cli but still the same error, today i received an update of npm and I also updated ionic cli but error is not resolved yet.

My Ionic CLI version is 6.11.1

1

There are 1 best solutions below

0
Mab Kiani On BEST ANSWER

Finally I fixed the issue after 2 days

Update to the latest version of @ionic/angular-toolkit

Run the following command

npm i @ionic/[email protected] --save-dev