Failed to compile. ./src/app/login/ Module not found: Error: Can't resolve 'ionic-angular' in ts file

import { Component, OnInit } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;

selector: ‘app-login’,
templateUrl: ‘./’,
styleUrls: [’./’],
export class LoginPage implements OnInit {
constructor(public navCtrl: NavController) { }

ngOnInit() {
alert('username: ’ + this.username)







<ion-content padding>

<input type=“text” [(ngModel)]=‘username’>

<button (click)=“submit()”>Submit</button>


when I serve the command it shows the error
Failed to compile.

Module not found: Error: Can’t resolve ‘ionic-angular’ in ‘C:\xampp\htdocs\test_ionic\firstionic\src\app\login’

I am using ionic4 beta version.why this error shows.please help anyone

You shouldn’t be using NavController at all, so if you get rid of all references to it, your problem will go away. The actual proximate cause is that v4 imports from @ionic/angular, not ionic-angular.

The previous post should be considered neither a solution nor something to be emulated. Never reference “node_modules” explicitly in imports.

i got the same issue as @asha4640 but i didn’t got any perfect solution because it runs on web but while building and running on app it fails with

vendor.js:48432 ERROR Error: Uncaught (in promise): Error: Cannot find module './login/login.module'
Error: Cannot find module './login/login.module'

Can anyone solve this. Please

for someone who get problem on same. i found the solution.
in your app routing module. try this way of importing

import { LoginPageModule } from './login/login.module';

const routes: Routes = [
  { path: 'login', loadChildren : ()=>LoginPageModule },

above is the class name and


this is the file location
do for every path in this way… it solved mine