Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module '@angular/core/src/metadata/lifecycle_hooks' - primeng/table/table.d.ts

I have got issue of importing primeNG table to my angular project. so i have import the table module to app.module.ts, i have got error.

ERROR in ./node_modules/primeng/components/dropdown/dropdown.js Module not found: Error: Can't resolve '@angular/cdk/scrolling' in 'D:\test angular\primengs\node_modules\primeng\components\dropdown' i 「wdm」: Failed to compile.

ERROR in node_modules/primeng/components/table/table.d.ts(5,27): error TS2307: Cannot find module '@angular/core/src/metadata/lifecycle_hooks'.
like image 363
Raheem Mohamed Avatar asked Jun 01 '19 12:06

Raheem Mohamed


2 Answers

I have found the solution for it. what i have done is Navigate to "/node_modules/primeng/components/table/table.d.ts". and line no 5 have this

import { OnDestroy } from '@angular/core/src/metadata/lifecycle_hooks'; 

i have changed to this.

import {OnDestroy } from '@angular/core';
like image 186
Raheem Mohamed Avatar answered Oct 23 '22 19:10

Raheem Mohamed


Make sure that your primeng version is compatible with your angular version.

like image 42
Ullas Prabhakar Avatar answered Oct 23 '22 19:10

Ullas Prabhakar