Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

yarn resolves incorrectly the datatables.net package vs npm #4176

Closed
ohadlevy opened this issue Aug 15, 2017 · 4 comments
Closed

yarn resolves incorrectly the datatables.net package vs npm #4176

ohadlevy opened this issue Aug 15, 2017 · 4 comments

Comments

@ohadlevy
Copy link

What is the current behavior?
yarn installs the wrong version of datatables.net

If the current behavior is a bug, please provide the steps to reproduce.
based on the following package.json

"datatables.net": "~1.10.12",
"datatables.net-bs": "~1.10.12",

yarns pulls 'https://registry.npmjs.org/datatables.net/-/datatables.net-2.1.1.tgz vs npm that fetches 1.10.15.

yarn info datatables.net

yarn info v0.27.5
{ name: 'datatables.net',
  description: 'DataTables for jQuery ',
  'dist-tags': { latest: '1.10.15' },
  versions: 
   [ '1.10.9',
     '1.10.10',
     '1.10.11',
     '1.10.12',
     '1.10.13',
     '1.10.14',
     '1.10.15',
     '2.1.1' ],
  maintainers: 
   [ { name: 'datatables',
       email: 'npm@datatables.net' } ],
  time: 
   { modified: '2017-08-14T13:41:33.823Z',
     created: '2015-10-07T14:04:13.605Z',
     '1.10.9': '2015-10-07T14:04:13.605Z',
     '1.10.10': '2015-11-07T09:52:23.863Z',
     '1.5.2': '2015-11-08T12:56:27.095Z',
     '1.1.2': '2016-12-30T10:39:59.743Z',
     '1.10.11': '2016-02-11T14:35:58.938Z',
     '1.10.12': '2016-05-20T13:01:04.540Z',
     '1.10.13': '2016-12-06T15:01:38.001Z',
     '1.4.2': '2016-12-21T14:51:05.047Z',
     '3.2.2': '2016-12-28T11:51:07.339Z',
     '2.1.1': '2017-01-18T12:16:02.047Z',
     '1.10.14': '2017-04-17T19:35:34.096Z',
     '1.10.15': '2017-04-18T08:25:28.730Z' },
  homepage: 'https://datatables.net',
  keywords: 
   [ 'filter',
     'sort',
     'DataTables',
     'jQuery',
     'table',
     'DataTables' ],
  author: 
   { name: 'SpryMedia Ltd',
     url: 'http://datatables.net' },
  bugs: { url: 'https://datatables.net/forums' },
  license: 'MIT',
  readmeFilename: 'Readme.md',
  users: 
   { lorro: true,
     onursumer: true,
     geduardcatalin: true,
     adseelquadri: true,
     samobo: true,
     whiskeyjack: true,
     monjer: true },
  repository: 
   { type: 'git',
     url: 'https://github.com/DataTables/Dist-DataTables.git' },
  version: '2.1.1',
  files: [ 'js/jquery.dataTables.js' ],
  main: './js/jquery.dataTables.js',
  dependencies: { jquery: '>=1.7' },
  dist: 
   { shasum: '6f1103ef08054642aecf85e7e25efd592822ee78',
     tarball: 'https://registry.npmjs.org/datatables.net/-/datatables.net-2.1.1.tgz' },
  directories: {},
  deprecated: 'Packing error' }
Done in 0.55s.

npm info datatables.net

{ name: 'datatables.net',
 description: 'DataTables for jQuery ',
 'dist-tags': { latest: '1.10.15' },
 versions: 
  [ '1.10.9',
    '1.10.10',
    '1.10.11',
    '1.10.12',
    '1.10.13',
    '1.10.14',
    '1.10.15',
    '2.1.1' ],
 maintainers: [ 'datatables <npm@datatables.net>' ],
 time: 
  { modified: '2017-08-14T13:41:33.823Z',
    created: '2015-10-07T14:04:13.605Z',
    '1.10.9': '2015-10-07T14:04:13.605Z',
    '1.10.10': '2015-11-07T09:52:23.863Z',
    '1.5.2': '2015-11-08T12:56:27.095Z',
    '1.1.2': '2016-12-30T10:39:59.743Z',
    '1.10.11': '2016-02-11T14:35:58.938Z',
    '1.10.12': '2016-05-20T13:01:04.540Z',
    '1.10.13': '2016-12-06T15:01:38.001Z',
    '1.4.2': '2016-12-21T14:51:05.047Z',
    '3.2.2': '2016-12-28T11:51:07.339Z',
    '2.1.1': '2017-01-18T12:16:02.047Z',
    '1.10.14': '2017-04-17T19:35:34.096Z',
    '1.10.15': '2017-04-18T08:25:28.730Z' },
 homepage: 'https://datatables.net',
 keywords: [ 'filter', 'sort', 'DataTables', 'jQuery', 'table', 'DataTables' ],
 author: 'SpryMedia Ltd (http://datatables.net)',
 bugs: { url: 'https://datatables.net/forums' },
 license: 'MIT',
 readmeFilename: 'Readme.md',
 users: 
  { lorro: true,
    onursumer: true,
    geduardcatalin: true,
    adseelquadri: true,
    samobo: true,
    whiskeyjack: true,
    monjer: true },
 repository: 
  { type: 'git',
    url: 'https://github.com/DataTables/Dist-DataTables.git' },
 version: '1.10.15',
 files: [ 'js/jquery.dataTables.js' ],
 main: './js/jquery.dataTables.js',
 dependencies: { jquery: '>=1.7' },
 dist: 
  { shasum: 'c789077bbfe385e75ff5a233fa5f23251a72df68',
    tarball: 'https://registry.npmjs.org/datatables.net/-/datatables.net-1.10.15.tgz' },
 directories: {} }

What is the expected behavior?

since the newer version of datatables was released incorrectly, I would really like to get the correct version using yarn :)

Please mention your node.js, yarn and operating system version.
node - v6.11.2
yarn - v0.27.5
OS - confirmed on fedora and rhel

Thanks!

@VGSebastian
Copy link

I can confirm the same issue on CentOS 7 with NodeJS RPM from nodesource.com and yarn RPM from yarnpkg.com.

@rally25rs
Copy link
Contributor

More info:

datatables.net-bs depends on:

    "dependencies": {
        "jquery": ">=1.7",
        "datatables.net": ">=1.10.9"
    },

The latest match for "datatables.net": ">=1.10.9" is datatables.net 2.1.1 so that is being installed underneath that dependency.

$: grep version node_modules/datatables.net/package.json
    "version": "1.10.15",

$: grep version node_modules/datatables.net-bs/node_modules/datatables.net/package.json
    "version": "2.1.1",

In other words, after Yarn install we get:

node_modules
  |- datatables.net@1.10.15
  \- datatables.net-bs@1.10.15
        \- datatables.new@2.1.1

NPM on the other hand seems to identify that datatables@1.10.15 satisfies "datatables.net": ">=1.10.9" and uses that, so after NPM install we get:

node_modules
  |- datatables.net@1.10.15
  \- datatables.net-bs@1.10.15

@arcanis
Copy link
Member

arcanis commented Aug 17, 2017

It's not a bug per-se, cf my comment here for the detailed explanation. TL;DR: datatables.net-bs should be using a peerDependency, not a dependency.

@BYK
Copy link
Member

BYK commented Aug 18, 2017

@rally25rs @arcanis - may be we should have a canned answer or dedicated label for these.

Also, I think we may do a better job when hoisting to prevent these a bit.

ohadlevy added a commit to ohadlevy/Dist-DataTables-Bootstrap that referenced this issue Aug 20, 2017
It seems that in some cases, using this package end up pulling a wrong version of DataTables, this change prevent that.

see yarnpkg/yarn#4176 for more info / backgroud.

Thanks!
@BYK BYK closed this as completed Oct 26, 2017
@BYK BYK removed the not-a-bug label Oct 26, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants