npm dependency issue with datatables.net-responsive and datatables.net-select
npm dependency issue with datatables.net-responsive and datatables.net-select
bturgeon
Posts: 3Questions: 0Answers: 0
In trying to run npm install today, we encountered some errors. It seems the dependencies specified in package.json on datatables.net-responsive (version 2.5.0) and datatables.net-select (version 1.7.0) is "datatables.net": ">=1.13.4" and is therefore now pulling in datatables.net 2.0 which is incompatible.
Replies
Thank you for flagging this up and apologies for the errors. I'll need to do a patch release of the older versions of these plugins to tighten up their dependency versions. Unfortunately, that isn't as simple as
npm publish
since I need to account for the CDN, Nuget and all of that, but I think that is an important point to fix.Until I can do that, specify a specific version of DataTables - 1.13.10 is the latest in the 1.x series:
Allan
Out of interest, can you show me the DataTables dependencies of your package.json file? Have you specified a specific version of Select or Responsive, but not DataTables? I'm wondering why DataTables would have updated, but not the other components.
Allan
Hi Allan,
The dependencies in our package.json are:
"datatables.net-select-bs4" was causing "datatables.net-select" v1.7.0 to get included, and within that package in node_modules was it's own node_modules folder containing datatables v.2.0 since it's dependencies listed
"datatables.net": ">=1.13.4"
In case anyone else encounters this, we were able to fix the build in our set up with the following in package.json
Ah! You aren't doing a flat node_modules structure. Thank you for the clarification and also for posting the workaround! Hopefully there won't be many hit by this error. I know now how to tighten up my dependency versions. Apologies again!
Allan
All good. Thanks for the quick response!
I must say that a week ago I met this dependency problem. In short, these code doesn't work any more. I've added "overrides" (which I was not aware of before )) but it didn't help. As soon as I include datatables-select 2.0.3 it pulls fresh datatables-net "2.1.2" out of nowhere
So I reverted "-select" to even older version, and it works
datatables-net-select
(current release is 2.0.3) has a dependency ondatatables.net
^2
- i.e. any v2 version. There was an error where Select 1.x used to have a dependency on>1.11
(resulting in any new version), but that was resolved with Select 2.If I try your dependencies:
And
npm install
that - I get DataTables 2.0.8 and Select 2.0.3. Not DataTables 2.1.2.Can you create a package.json that shows the issue please?
Thanks,
Allan
Don't know how it happens. I've sent actual package.json but seems it waits for you adoption.
Where did you sent it? You could paste it in, or attach it here.
Allan
I pasted it here, but after some editing the forum engine said "the message is need to be checked by the admin"
That gives me:
Allan
Yeah, probably you've enabled some strict settings.
Which version of Node.js and NPM do you have, by the way?
I must admit that after releasing Datatables 2.1.3 most problems with the new version 2.1 are gone. So now I'm stopping to struggle with dependencies, thanks for answering!
Good to hear that 2.1.3 appears to help though!
Allan