ERROR in Metadata version Mismatch for module in Angular

Asked

Viewed 250 times

0

I’m making that mistake;

ERROR in Metadata version Mismatch for module C:/Rei das cochinhas/API/restaurantui/node_modules/primeng/Components/inputtext/inputtext.d.ts, found version 4, expected 3, resolving Symbol Adminmodule in

C:/Cochinhas King/API/restaurantui/src/app/admin/admin.module.ts, resolving Symbol Adminmodule in C:/Rei das cochinhas/API/restaurantui/src/app/admin/admin.modulets.

I’ll explain when it happens.

I turn on the computer and run all the services to run the system like Mongodb and Node Express, then I run Angular with the command ng server after it compiles it generates the error then;

inserir a descrição da imagem aqui

Error informs that the problem is in the file Adminmodule, what is very strange is that there is no error in that file. However for my application to go up I have to simply change anything in the file, save and it comes back working and the error disappears.

But what kind of change do I make to the file? It’s kind of like making space in the file without changing any chunks of code.

I find this kind of mistake very strange, I need to fix even if I manage to evolve this project because I’m going to send it to the cloud server, and I can’t keep it like this;

This is the Adminmodule file;

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { MainComponent } from './restaurant/main/main.component';
import { ListComponent } from './restaurant/list/list.component';
import { AddComponent } from './restaurant/add/add.component';
import { EditComponent } from './restaurant/edit/edit.component';
import { AdminRoutingModule } from './routes/admin-routing.module';
import { SharedModule } from '../shared/shared.module';
import { AddmenuComponent } from './menu/addmenu/addmenu.component';
import { ListmenuComponent } from './menu/listmenu/listmenu.component';
import { EditmenuComponent } from './menu/editmenu/editmenu.component';

import { InputTextModule } from 'primeng/components/inputtext/inputtext';
import { ButtonModule } from 'primeng/components/button/button';
import { DataTableModule } from 'primeng/components/datatable/datatable';
import { TooltipModule } from 'primeng/components/tooltip/tooltip';


@NgModule({
  imports: [
    CommonModule,
    BrowserAnimationsModule,

    FormsModule,
    AdminRoutingModule,
    SharedModule,
   // modulos de terceiros

   InputTextModule,
   ButtonModule,
   DataTableModule,
   TooltipModule

  ],
  declarations: [
    MainComponent, 
    ListComponent, 
    AddComponent, 
    EditComponent,


    AddmenuComponent, 
    ListmenuComponent, 
    EditmenuComponent
  ],
  exports: [
    MainComponent, 
    ListComponent, 
    AddComponent, 
    EditComponent, 


    AddmenuComponent, 
    ListmenuComponent, 
    EditmenuComponent
  ], 

})
export class AdminModule { }

I need to ask questions, I’ll be available.

This is my package.json file

{
  "name": "meat",
  "version": "1.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
    "test": "ng test",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "4.0.2",
    "@angular/common": "4.0.2",
    "@angular/compiler": "4.0.2",
    "@angular/compiler-cli": "4.0.2",
    "@angular/core": "4.0.2",
    "@angular/forms": "4.0.2",
    "@angular/http": "4.0.2",
    "@angular/platform-browser": "4.0.2",
    "@angular/platform-browser-dynamic": "4.0.2",
    "@angular/router": "4.0.2",
    "admin-lte": "2.3.11",
    "core-js": "2.4.1",
    "font-awesome": "4.7.0",
    "intl": "1.2.5",
    "jquery": "3.1.1",
    "primeicons": "^1.0.0-beta.10",
    "primeng": "^6.1.2",
    "reflect-metadata": "0.1.9",
    "rxjs": "5.4.3",
    "ts-helpers": "1.1.2",
    "web-animations-js": "^2.3.1",
    "zone.js": "0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "1.2.7",
    "@angular/compiler-cli": "4.0.2",
    "@types/jasmine": "2.5.38",
    "@types/node": "7.0.5",
    "codelyzer": "2.0.0",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "3.2.0",
    "karma": "1.4.1",
    "karma-chrome-launcher": "2.0.0",
    "karma-cli": "1.0.1",
    "karma-jasmine": "1.1.0",
    "karma-remap-istanbul": "0.2.2",
    "protractor": "5.1.0",
    "ts-node": "2.1.0",
    "tslint": "4.5.0",
    "typescript": "2.5.2",
    "webdriver-manager": "10.2.5"
  }
}

I tried to change @angular/cli is in version "1.2.7" to 4.0.2, then I tried, and ran the npm install and created this problem;

inserir a descrição da imagem aqui

Luckily I have an earlier version of the project without the modification.

  • Can make your package.json to check the versions? By the way, I don’t mean to intrude, but "drumsticks" is with x.

  • @Sorack thanks for the calligraphy say, I wrote quick hahahah already I will update my post.

  • just updated, you can see my file package.json

  • Your @angular/cli is in version "1.2.7" while the others are in version "4.0.2"

  • Should I change the version from 1.2.7 to 4.0.2 ?

  • yes, change it to see if it is this dependency that is in trouble

  • i did an update of my post could take a look at.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.