0
votes

While doing ng build --prod in an angular 4 project, I am getting the following issue:

  • @angular/cli Version: 1.1.2

  • node Version: 6.11.0

ERROR in Metadata version mismatch for module F:/Platform_UI_New/node_modules/ng-sidebar/lib/index.d.ts, found version 4, exp ected 3, resolving symbol AppModule in F:/Platform_UI_New/src/app/app.module.ts, resolving symbol AppModule in F:/Platform_UI _New/src/app/app.module.ts, resolving symbol AppModule in F:/Platform_UI_New/src/app/app.module.ts

The Package.json file for my project is as follows:

{
      "name": "angular-quickstart",
      "version": "1.0.0",
      "description": "QuickStart package.json from the documentation, supplemented with testing support",
      "scripts": {
        "build": "tsc -p src/",
        "build:watch": "tsc -p src/ -w",
        "build:e2e": "tsc -p e2e/",
        "serve": "lite-server -c=bs-config.json",
        "serve:e2e": "lite-server -c=bs-config.e2e.json",
        "prestart": "npm run build",
        "start": "concurrently \"npm run build:watch\" \"npm run serve\"",
        "pree2e": "npm run build:e2e",
        "e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
        "preprotractor": "webdriver-manager update",
        "protractor": "protractor protractor.config.js",
        "pretest": "npm run build",
        "test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
        "pretest:once": "npm run build",
        "test:once": "karma start karma.conf.js --single-run",
        "lint": "tslint ./src/**/*.ts -t verbose"
      },
      "repository": {},
      "keywords": [],
      "author": "",
      "license": "MIT",
      "dependencies": {
        "@amcharts/amcharts3-angular": "^1.2.0",
        "@angular/animations": "^4.1.3",
        "@angular/cli": "^1.0.4",
        "@angular/common": "^4.1.3",
        "@angular/compiler": "^4.1.3",
        "@angular/compiler-cli": "^4.1.3",
        "@angular/core": "^4.1.3",
        "@angular/forms": "^4.1.3",
        "@angular/http": "^4.1.3",
        "@angular/material": "^2.0.0-beta.5",
        "@angular/platform-browser": "^4.1.3",
        "@angular/platform-browser-dynamic": "^4.1.3",
        "@angular/platform-server": "^4.1.3",
        "@angular/router": "^4.1.3",
        "angular-in-memory-web-api": "~0.3.0",
        "angular-material": "^1.1.5",
        "core-js": "^2.4.1",
        "hammerjs": "^2.0.8",
        "md-collection-pagination": "^1.0.3",
        "mydaterangepicker": "^4.1.9",
        "ng-sidebar": "^7.1.0",
        "ng2-tree": "^2.0.0-rc.4",
        "ngx-toggle-switch": "^1.3.9",
        "rxjs": "5.0.1",
        "systemjs": "0.19.40",
        "typescript": "^2.3.2",
        "ui-navbar": "^0.5.2",
        "zone.js": "^0.8.4"
      },
      "devDependencies": {
        "@angular/cli": "1.0.0",
        "@angular/compiler-cli": "^4.0.0",
        "@types/hammerjs": "^2.0.34",
        "@types/jasmine": "2.5.36",
        "@types/node": "^6.0.46",
        "canonical-path": "0.0.2",
        "concurrently": "^3.2.0",
        "jasmine-core": "~2.4.1",
        "karma": "^1.3.0",
        "karma-chrome-launcher": "^2.0.0",
        "karma-cli": "^1.0.1",
        "karma-jasmine": "^1.0.2",
        "karma-jasmine-html-reporter": "^0.2.2",
        "lite-server": "^2.2.2",
        "lodash": "^4.16.4",
        "node-sass": "^4.5.3",
        "protractor": "~4.0.14",
        "rimraf": "^2.5.4",
        "sass-loader": "^6.0.5",
        "tslint": "^3.15.1",
        "typescript": "~2.2.0"
      }
    }
1

1 Answers

0
votes

What this error means is ng-sidebar module's version is not compatible to your Angular CLI version. Current Angular CLI version is 1.7.4 (As of 30-04-2018). So, either you can update your angular CLI version or you can find the version of ng-sidebar which is compatible to your current angular CLI version.