npm dependency issue with datatables.net-responsive and datatables.net-select

npm dependency issue with datatables.net-responsive and datatables.net-select

bturgeonbturgeon 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

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    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:

    npm install datatables.net@1.13.10
    

    Allan

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    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

  • bturgeonbturgeon Posts: 3Questions: 0Answers: 0

    Hi Allan,

    The dependencies in our package.json are:

    "datatables.net": "1.13.4",
        "datatables.net-bs4": "1.12.1",
        "datatables.net-buttons-bs4": "1.7.1",
        "datatables.net-colreorder": "1.5.6",
        "datatables.net-responsive-bs4": "2.3.0",
        "datatables.net-rowreorder-bs4": "1.2.8",
        "datatables.net-select-bs4": "1.4.0"
    

    "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

    "overrides": {
        "datatables.net-responsive-bs4": {
          "datatables.net-responsive": "^2.2.9"
        },
        "datatables.net-responsive": {
          "datatables.net": "^1.13.4"
        },
        "datatables.net-select-bs4": {
          "datatables.net-select": "^1.3.3"
        },
        "datatables.net-select": {
          "datatables.net": "^1.13.4"
        }
      },
    
  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    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

  • bturgeonbturgeon Posts: 3Questions: 0Answers: 0

    All good. Thanks for the quick response!

Sign In or Register to comment.