ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

old libp2p librairies are included with 'npm install ipfs' #3117

Closed olivier-nerot closed 4 years ago

olivier-nerot commented 4 years ago

Hello,

From a fresh install, when I do a npm install ipfs or yarn add ipfs, the installed version is 0.46, as waited, but the package.json includes surprisingly old libp2p libraries. For example 'libp2p-kad-dht': '^0.18.7', even if the latest package.json asks to use "libp2p-kad-dht": "^0.19.5". This breaks code, as 0.18.7 still use peerInfo, whereas ipfs send peerid, for example.

After having removed node_modules directory, I do yarn add ipfs, then yarn info ipfs, which returns :

version: '0.46.0',
  leadMaintainer: 'Alex Potsides <alex@achingbrain.net>',
  main: 'src/core/index.js',
  browser: {
    './src/core/runtime/init-assets-nodejs.js': './src/core/runtime/init-assets-browser.js',
    './src/core/runtime/config-nodejs.js': './src/core/runtime/config-browser.js',
    './src/core/runtime/dns-nodejs.js': './src/core/runtime/dns-browser.js',
    './src/core/runtime/libp2p-nodejs.js': './src/core/runtime/libp2p-browser.js',
    './src/core/runtime/libp2p-pubsub-routers-nodejs.js': './src/core/runtime/libp2p-pubsub-routers-browser.js',
    './src/core/runtime/preload-nodejs.js': './src/core/runtime/preload-browser.js',
    './src/core/runtime/repo-nodejs.js': './src/core/runtime/repo-browser.js',
    './src/core/runtime/ipld-nodejs.js': './src/core/runtime/ipld-browser.js',
    './test/utils/create-repo-nodejs.js': './test/utils/create-repo-browser.js'
  },
  bin: {
    jsipfs: 'src/cli/bin.js'
  },
  scripts: {
    lint: 'aegir lint',
    build: 'aegir build',
    test: 'aegir test',
    'test:node': 'aegir test -t node',
    'test:browser': 'aegir test -t browser',
    'test:browser:http': 'aegir test -t browser -f test/http-api/index.js',
    'test:webworker': 'aegir test -t webworker',
    'test:electron': 'aegir test -t electron-main  -t electron-renderer',
    'test:electron-main': 'aegir test -t electron-main',
    'test:electron-renderer': 'aegir test -t electron-renderer',
    'test:cli': 'aegir test -t node -f test/cli/index.js',
    'test:node:core': 'aegir test -t node -f test/core/**/*.js',
    'test:node:http': 'aegir test -t node -f test/http-api/index.js',
    'test:node:gateway': 'aegir test -t node -f test/gateway/index.js',
    'test:interface': 'aegir test -f test/core/interface.spec.js',
    'test:interface:http': 'aegir test -f test/http-api/interface.js',
    'test:bootstrapers': 'IPFS_TEST=bootstrapers aegir test -t browser -f test/bootstrapers.js',
    'test:interop': 'cross-env IPFS_JS_EXEC=$PWD/src/cli/bin.js IPFS_JS_MODULE=$PWD IPFS_JS_HTTP_MODULE=$PWD/../ipfs-http-client IPFS_REUSEPORT=false ipfs-interop',
    'test:interop:node': 'cross-env IPFS_JS_EXEC=$PWD/src/cli/bin.js IPFS_JS_MODULE=$PWD IPFS_JS_HTTP_MODULE=$PWD/../ipfs-http-client IPFS_REUSEPORT=false ipfs-interop -- -t node',
    'test:interop:browser': 'cross-env IPFS_JS_EXEC=$PWD/src/cli/bin.js IPFS_JS_MODULE=$PWD IPFS_JS_HTTP_MODULE=$PWD/../ipfs-http-client IPFS_REUSEPORT=false ipfs-interop -- -t browser',
    'test:interop:electron-main': 'cross-env IPFS_JS_EXEC=$PWD/src/cli/bin.js IPFS_JS_MODULE=$PWD IPFS_JS_HTTP_MODULE=$PWD/../ipfs-http-client IPFS_REUSEPORT=false ipfs-interop -- -t electron-main -f ./test/node.js',
    'test:interop:electron-renderer': 'cross-env IPFS_JS_EXEC=$PWD/src/cli/bin.js IPFS_JS_MODULE=$PWD IPFS_JS_HTTP_MODULE=$PWD/../ipfs-http-client IPFS_REUSEPORT=false ipfs-interop -- -t electron-renderer -f ./test/browser.js',
    'test:external': 'aegir test-dependant',
    coverage: 'nyc --reporter=text --reporter=lcov npm run test:node',
    clean: 'rm -rf ./dist',
    'dep-check': 'aegir dep-check'
  },
  dependencies: {
    '@hapi/ammo': '^3.1.2',
    '@hapi/boom': '^7.4.3',
    '@hapi/content': '^4.1.0',
    '@hapi/hapi': '^18.4.0',
    '@hapi/joi': '^15.1.0',
    'abort-controller': '^3.0.0',
    'any-signal': '^1.1.0',
    'array-shuffle': '^1.0.1',
    'bignumber.js': '^9.0.0',
    bl: '^4.0.2',
    bs58: '^4.0.1',
    buffer: '^5.6.0',
    byteman: '^1.3.5',
    'cid-tool': '^0.4.0',
    cids: '^0.8.0',
    'class-is': '^1.1.0',
    'dag-cbor-links': '^1.3.3',
    'datastore-core': '^1.1.0',
    'datastore-level': '^1.1.0',
    'datastore-pubsub': '^0.3.2',
    debug: '^4.1.0',
    dlv: '^1.1.3',
    'err-code': '^2.0.0',
    'file-type': '^14.1.4',
    fnv1a: '^1.0.1',
    'get-folder-size': '^2.0.0',
    'hamt-sharding': '^1.0.0',
    'hapi-pino': '^6.1.0',
    hashlru: '^2.3.0',
    'interface-datastore': '^1.0.2',
    'ipfs-bitswap': '^1.0.0',
    'ipfs-block-service': '^0.17.1',
    'ipfs-core-utils': '^0.2.3',
    'ipfs-http-client': '^44.2.0',
    'ipfs-http-response': '^0.5.0',
    'ipfs-repo': '^3.0.0',
    'ipfs-unixfs': '^1.0.3',
    'ipfs-unixfs-exporter': '^2.0.2',
    'ipfs-unixfs-importer': '^2.0.2',
    'ipfs-utils': '^2.2.2',
    ipld: '^0.26.2',
    'ipld-bitcoin': '^0.3.0',
    'ipld-block': '^0.9.1',
    'ipld-dag-cbor': '^0.15.2',
    'ipld-dag-pb': '^0.18.5',
    'ipld-ethereum': '^4.0.0',
    'ipld-git': '^0.5.0',
    'ipld-raw': '^4.0.1',
    'ipld-zcash': '^0.4.0',
    ipns: '^0.7.1',
    'is-domain-name': '^1.0.1',
    'is-ipfs': '^1.0.3',
    'iso-url': '^0.4.7',
    'it-all': '^1.0.1',
    'it-concat': '^1.0.0',
    'it-drain': '^1.0.1',
    'it-glob': '0.0.7',
    'it-last': '^1.0.1',
    'it-map': '^1.0.0',
    'it-multipart': '^1.0.1',
    'it-pipe': '^1.1.0',
    'it-tar': '^1.2.2',
    'it-to-stream': '^0.1.1',
    'iterable-ndjson': '^1.1.0',
    jsondiffpatch: '^0.4.1',
    'just-safe-set': '^2.1.0',
    libp2p: '^0.27.7', // should be ^0.28.0
    'libp2p-bootstrap': '^0.10.3', // should be ^0.11.0
    'libp2p-crypto': '^0.17.6',
    'libp2p-delegated-content-routing': '^0.4.4', // should be ^0.5.0
    'libp2p-delegated-peer-routing': '^0.4.2',  // should be ^0.5.0
    'libp2p-floodsub': '^0.20.4', // should be ^0.21.0
    'libp2p-gossipsub': '^0.3.1', // should be ^0.4.0
    'libp2p-kad-dht': '^0.18.7', // should be ^0.19.5
    'libp2p-keychain': '^0.6.0',
    'libp2p-mdns': '^0.13.1', // should be ^0.14.0
    'libp2p-mplex': '^0.9.3',
    'libp2p-record': '^0.7.3',
    'libp2p-secio': '^0.12.2',
    'libp2p-tcp': '^0.14.5',
    'libp2p-webrtc-star': '^0.17.10', // should be ^0.18.0
    'libp2p-websockets': '^0.13.3',
    mafmt: '^7.0.0',
    'merge-options': '^2.0.0',
    mortice: '^2.0.0',
    multiaddr: '^7.4.3',
    'multiaddr-to-uri': '^5.1.0',
    multibase: '^0.7.0',
    multicodec: '^1.0.0',
    multihashes: '^0.4.19',
    'multihashing-async': '^0.8.0',
    'p-defer': '^3.0.0',
    'p-queue': '^6.1.0',
    'parse-duration': '^0.1.2',
    'peer-id': '^0.13.12',
    'peer-info': '^0.17.0',
    'pretty-bytes': '^5.3.0',
    progress: '^2.0.1',
    protons: '^1.2.0',
    semver: '^7.3.2',
    'stream-to-it': '^0.2.0',
    'streaming-iterables': '^4.1.1',
    temp: '^0.9.0',
    'timeout-abort-controller': '^1.1.0',
    'update-notifier': '^4.0.0',
    'uri-to-multiaddr': '^3.0.2',
    varint: '^5.0.0',
    yargs: '^15.1.0',
    'yargs-promise': '^1.1.0',
    'prom-client': '^12.0.0',
    'prometheus-gc-stats': '^0.6.0'
  },
welcome[bot] commented 4 years ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

achingbrain commented 4 years ago

ipfs@0.46.x shipped with libp2p@0.27.x so this would only break if you're trying to use libp2p@0.28.x compatible modules with libp2p@0.27.x.

That said, ipfs@0.47.x has just shipped with libp2p@0.28.x so you should be good now.