New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in Error: Metadata version mismatch for module .... /Cliente/node_modules/@ng-bootstrap/ng-bootstrap/index.d.ts, found version 4, ex pected 3, resolving symbol SharedModule.... #2039

Closed
inferiore opened this Issue Dec 14, 2017 · 5 comments

Comments

Projects
None yet
6 participants
@inferiore
Copy link

inferiore commented Dec 14, 2017

Hello everyone, i am trying to install this template in angular 4 but when write ng serve comand i get this error.
i use node 6.11.3 and npm 3.10.10
this is a instructión for install template.
captura

ERROR in Error: Metadata version mismatch for module C:/Users/Eder/Desktop/Tesis
/Cliente/node_modules/@ng-bootstrap/ng-bootstrap/index.d.ts, found version 4, ex
pected 3, resolving symbol SharedModule in C:/Users/Eder/Desktop/Tesis/Cliente/s
rc/app/shared/shared.module.ts, resolving symbol SharedModule in C:/Users/Eder/D
esktop/Tesis/Cliente/src/app/shared/shared.module.ts, resolving symbol SharedMod
ule in C:/Users/Eder/Desktop/Tesis/Cliente/src/app/shared/shared.module.ts
at Error (native)
at syntaxError (C:\Users\Eder\Desktop\Tesis\Cliente\node_modules@angular\co
mpiler\bundles\compiler.umd.js:1729:34)
at simplifyInContext (C:\Users\Eder\Desktop\Tesis\Cliente\node_modules@angu
lar\compiler\bundles\compiler.umd.js:24979:23)
at StaticReflector.simplify (C:\Users\Eder\Desktop\Tesis\Cliente\node_module
s@angular\compiler\bundles\compiler.umd.js:24991:13)
at StaticReflector.annotations (C:\Users\Eder\Desktop\Tesis\Cliente\node_mod
ules@angular\compiler\bundles\compiler.umd.js:24418:41)
at _getNgModuleMetadata (C:\Users\Eder\Desktop\Tesis\Cliente\node_modules@a
ngular\compiler-cli\src\ngtools_impl.js:138:31)
at _extractLazyRoutesFromStaticModule (C:\Users\Eder\Desktop\Tesis\Cliente\n
ode_modules@angular\compiler-cli\src\ngtools_impl.js:109:26)
at C:\Users\Eder\Desktop\Tesis\Cliente\node_modules@angular\compiler-cli\sr
c\ngtools_impl.js:129:27
at Array.reduce (native)
at _extractLazyRoutesFromStaticModule (C:\Users\Eder\Desktop\Tesis\Cliente\n
ode_modules@angular\compiler-cli\src\ngtools_impl.js:128:10)
at Object.listLazyRoutesOfModule (C:\Users\Eder\Desktop\Tesis\Cliente\node_m
odules@angular\compiler-cli\src\ngtools_impl.js:53:22)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\Users\Eder\Desktop\T
esis\Cliente\node_modules@angular\compiler-cli\src\ngtools_api.js:91:39)
at AotPlugin._getLazyRoutesFromNgtools (C:\Users\Eder\Desktop\Tesis\Cliente
node_modules@ngtools\webpack\src\plugin.js:207:44)
at _donePromise.Promise.resolve.then.then.then.then.then (C:\Users\Eder\Desk
top\Tesis\Cliente\node_modules@ngtools\webpack\src\plugin.js:443:24)
at process._tickCallback (internal/process/next_tick.js:109:7)

webpack: Failed to compile.

any solution?

@bvd

This comment has been minimized.

Copy link

bvd commented Dec 14, 2017

You should probably use angular 5 because this type of problem appears with other modules as well that were built depending on Angular 5 (just like this new version of @ng-bootstrap).

see also https://stackoverflow.com/questions/47534610/error-in-metadata-version-mismatch-for-module-x-found-version-4-expected-3-res/47534611#47534611

@pkozlowski-opensource

This comment has been minimized.

Copy link
Member

pkozlowski-opensource commented Dec 14, 2017

You need angular ^5.0.2 as expressed in https://ng-bootstrap.github.io/#/getting-started:

(requires Angular version 5 or higher, tested with 5.0.2)

package.json constraints and changelog.

borchsenius added a commit to borchsenius/favorite-frameworks that referenced this issue Dec 20, 2017

specific version of ng-bootstrap
This is a well known bug ng-bootstrap/ng-bootstrap#2039
Apparently the latest version og ng-bootstrap is not compatible with angular version  ~4.3
@borchsenius

This comment has been minimized.

Copy link

borchsenius commented Dec 20, 2017

or you could just specify a fixed version in your package.json.
"@ng-bootstrap/ng-bootstrap": "1.0.0-beta.4",
beta.4 is compatible with angular4.
Upgrading to latest version of angular is of course the better solution

@awaisarif1993

This comment has been minimized.

Copy link

awaisarif1993 commented Dec 22, 2017

I got the same error

Probably in your package.json you have the following:

"@ng-bootstrap/ng-bootstrap": "^<VERSION_HERE>"

The problem is with the dependecies versions, so you can just update everthing to the last version, there is a topic in stackoverflow already: Metadata version mismatch with Angular 4

Or in my case that I couldn't just update all packages,I did the following:

I removed the package, also removed the ^ signal before the version number and then ran npm i again.

After this the app worked properly.

@thorveakshay

This comment has been minimized.

Copy link

thorveakshay commented Feb 5, 2018

Try

npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest -g --save

This will upgrade Angular from any version to latest version. I was also facing some issues this upgrade solved issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment