l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.57k stars 481 forks source link

CANNOT FIND NAMESPACE DATATABLES #1797

Closed NishalyV closed 2 weeks ago

NishalyV commented 3 weeks ago

while using angular-datatables - 12 version or above any version iam getting this error and i can't able to run npm i @types/datatables.net --> this one fixes issue in temporarily again deleting nodemodules and packagelock.json again iam getting error, i can run only npm install

Danielku15 commented 2 weeks ago

Angular-datatables 17.0.0 seem to rely on @types/datatables.net@1.10.2 for the types while the official datatables.net package would ship own types.

Try npm i @types/datatables.net@1.10.2 (or matching the version you use)

Worked for me 😄

17.1.0 moved away from @types/datatables.net it seems but we're not yet on that version.

NishalyV commented 2 weeks ago

if i use match version also iam getting same error My versions are angular-datatables - 12.0.2 types/datatables.net - 1.10.19 datatables.net - 2.0.7 datatables.net-dt - 2.0.7 My code is working after npm install, i again install this npm i @types/datatables.net@1.10.19. But i need this should be working in the npm install itself because while moving production or dev we can't install this package again. 1st time install angular-datatables directive, it is pointing to datatables.net -->types-->types.d.ts after installing particular package it is pointing to @types-->datatables.net -->index.d.ts

theengineer0101 commented 2 weeks ago

Hey NishalyV, I ran into this error when I installed a version higher than @types/datatables.net@1.10.21. I would say install the version in your devDepenendicaes to match the version in the repo.

Danielku15 commented 2 weeks ago

@NishalyV

tl;dr: I think your only options are:

a) Downgrade the datatables packages to compatible versions:

b) Upgrade your project to Angular 17 and use angular-datatables@17.1.0, use the latest datatables 2.0.8 and fully remove @types/datatables.

Longer version

Seems you are mixing incompatible datatables.net and angular-datatables versions with also incompatible @types/datatables.