'when typing ng serve im getting this error [closed]

cmd screenshotstrong text

"export 'AnimationEngine' (imported as 'ɵngcc1') was not found in '@angular/animations/browser'

ERROR in ./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/animations.js 231:73-95
"export 'AnimationEngine' (imported as 'ɵngcc1') was not found in '@angular/animations/browser'

ERROR in ./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/animations.js 380:209-240
"export 'AnimationStyleNormalizer' (imported as 'ɵngcc1') was not found in '@angular/animations/browser'

ERROR in ./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/animations.js 392:60-91
"export 'AnimationStyleNormalizer' (imported as 'ɵngcc1') was not found in '@angular/animations/browser'


Solution 1:[1]

Can you try this first remove node_modules folder from your project & then again try to install npm using npm install

Solution 2:[2]

You forgot to run npm i first run this then run ng serve

if you have node_modules folder then first remove folder then run npm i

Solution 3:[3]

I experienced this error after upgrading an Angular 2 app straight to Angular 10. After upgrading packages and adding packages to get everything working again, I got the same error after adding BrowserAnimationsModule. It was fixed by modifying tsconfig.json and settings compilerOptions.module to "esnext".

{
  "compilerOptions": {
    "baseUrl": "",
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es2017", "dom"],
    "mapRoot": "./",
    "module": "esnext", //<-- Set this to esnext. 
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 umang naik
Solution 2 Abdul Moiz
Solution 3 King Leon