简体   繁体   中英

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

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 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

Finally I fixed the issue after 2 days

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

Run the following command

npm i @ionic/angular-toolkit@2.3.3 --save-dev

We have updated angular-toolkit and tried, but still same issue. Please check following error.

$ ionic g page sample

ng.cmd generate page sample --project=app An unhandled exception occurred: Schematic "page" not found in collection "@angular-eslint/schematics". See "C:\\Users\\venuk\\AppData\\Local\\Temp\\ng-8HGfRP\\angular-errors.log" for further details. [ERROR] Could not generate page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM