I am doing migration for angular, here is the previous package.json posted:

  "name": "test123",
  "version": "0.0.0",
  "license": "MIT",
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.4.6",
    "@angular/cli": "1.4.1",
    "@angular/common": "^4.4.6",
    "@angular/compiler": "^4.4.6",
    "@angular/compiler-cli": "^4.4.6",
    "@angular/core": "^4.4.6",
    "@angular/forms": "^4.4.6",
    "@angular/http": "^4.4.6",
    "@angular/language-service": "^4.4.6",
    "@angular/platform-browser": "^4.4.6",
    "@angular/platform-browser-dynamic": "^4.4.6",
    "@angular/platform-server": "^4.4.6",
    "@angular/router": "^4.4.6",
    "@jaspero/ng2-confirmations": "^0.3.3",
    "@types/google-maps": "^3.2.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "^6.0.90",
    "angular-confirmation-popover": "^3.2.0",
    "angular-font-awesome": "^2.3.7",
    "angular2-datatable-pagination": "git+https://github.com/CasperTech/angular2-datatable-pagination.git",
    "angular2-json2csv": "^1.1.2",
    "angular2-lightbox": "^1.2.1",
    "bootstrap": "^3.3.7",
    "chart.js": "^2.7.1",
    "codelyzer": "~3.1.1",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "jquery": "^3.2.1",
    "jquery-ui-dist": "^1.12.1",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ng-animate": "^0.3.1",
    "ng-pick-datetime": "^5.0.0-beta.11",
    "ng-sweetalert2-slc": "^0.1.7",
    "ng2-archwizard": "^2.1.0",
    "ng2-charts": "^1.6.0",
    "ng2-completer": "^1.6.3",
    "ng2-datetime-picker": "^0.15.1",
    "ng2-map": "^0.16.5",
    "ng2-simple-autocomplete": "^0.6.1",
    "ng2-smart-table": "^1.2.2",
    "ng2-sweetalert2": "0.0.8",
    "ng2-toasty": "^4.0.3",
    "ng2-validation": "^4.2.0",
    "ngx-facebook": "^2.4.0",
    "node-sass": "^4.11.0",
    "popper.js": "^1.12.6",
    "protractor": "~5.1.2",
    "rxjs": "^5.5.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "~2.3.3",
    "zone.js": "^0.8.18"
  },
  "devDependencies": {}
}

Here is the new package.json posted:

{
  "name": "test123",
  "version": "0.0.0",
  "license": "MIT",
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.15",
    "@angular/common": "^7.2.15",
    "@angular/compiler": "^7.2.15",
    "@angular/compiler-cli": "^7.2.15",
    "@angular/core": "^7.2.15",
    "@angular/forms": "^7.2.15",
    "@angular/http": "^7.2.15",
    "@angular/language-service": "^7.2.15",
    "@angular/platform-browser": "^7.2.15",
    "@angular/platform-browser-dynamic": "^7.2.15",
    "@angular/platform-server": "^7.2.15",
    "@angular/router": "^7.2.15",
    "@jaspero/ng2-confirmations": "^0.3.3",
    "@types/google-maps": "^3.2.0",
    "@types/jasmine": "~3.3.12",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "^12.0.0",
    "angular-confirmation-popover": "^4.2.0",
    "angular-font-awesome": "^3.1.2",
    "angular2-datatable-pagination": "0.0.3",
    "angular2-json2csv": "^1.1.2",
    "angular2-lightbox": "^1.2.1",
    "bootstrap": "^4.3.1",
    "chart.js": "^2.7.1",
    "codelyzer": "~5.0.1",
    "core-js": "^3.0.1",
    "font-awesome": "^4.7.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "jquery": "^3.2.1",
    "jquery-ui-dist": "^1.12.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-cli": "~2.0.0",
    "karma-coverage-istanbul-reporter": "^2.0.5",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "ng-animate": "^0.3.1",
    "ng-pick-datetime": "^7.0.0",
    "ng-sweetalert2-slc": "^0.1.7",
    "ng2-archwizard": "^2.1.0",
    "ng2-charts": "^2.2.3",
    "ng2-completer": "^2.0.8",
    "ng2-datetime-picker": "^0.15.1",
    "ng2-map": "^0.16.5",
    "ng2-simple-autocomplete": "^0.6.1",
    "ng2-smart-table": "^1.2.2",
    "ng2-sweetalert2": "0.0.8",
    "ng2-toasty": "^4.0.3",
    "ng2-validation": "^4.2.0",
    "ngx-facebook": "^2.4.0",
    "node-sass": "^4.11.0",
    "popper.js": "^1.12.6",
    "protractor": "~5.4.2",
    "rxjs": "^6.5.2",
    "rxjs-compat": "^6.0.0-rc.0",
    "ts-node": "~8.1.0",
    "tslib": "^1.9.0",
    "tslint": "~5.16.0",
    "typescript": "~3.1.6",
    "webpack": "^4.31.0",
    "zone.js": "^0.9.1"
  },
  "devDependencies": {
    "@angular/cli": "^7.3.9",
    "@angular-devkit/build-angular": "~0.13.0"
  }
}

while doing migration getting error on command 'ng serve':

ERROR in No NgModule metadata found for 'AppModule'. webpack: Failed to compile.

and even the error found on command 'ng build --prod':

ERROR in : TypeError: Cannot read property 'flags' of undefined at checkUnreachable (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:29004:31) at bindChildrenWorker (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:27023:17) at bindChildren (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:26979:17) at bind (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:28257:21) at bindSourceFile (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:26593:17) at Object.bindSourceFile (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:26534:9) at initializeTypeChecker (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:56480:20) at Object.createTypeChecker (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:30758:9) at getDiagnosticsProducingTypeChecker (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85043:93) at /home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85171:35 at runWithCancellationToken (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85144:24) at getSemanticDiagnosticsForFileNoCache (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85167:20) at getAndCacheDiagnostics (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85415:26) at getSemanticDiagnosticsForFile (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85164:20) at getDiagnosticsHelper (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85106:24) at Object.getSemanticDiagnostics (/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85119:20)

  1. Tried clearing cache and reinstalling :

    1. rm -rf node_modules dist
    2. npm cache clean --force
    3. // Add latest typescript in package.json
    4. // Delete package_lock.json
    5. npm install
  2. Tried migration from scratch using the link:

    1. https://update.angular.io/
  3. Tried removing typescript then tslint then angular-cli

  4. Tried changing the versions of typescript, tslint, angular-cli

Tried many other things, None any solution work for me.

0 Answers