libp2p / js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
https://github.com/libp2p/js-libp2p-peer-id
MIT License
80 stars 44 forks source link

npm package peer-id 0.12.3 incompatible with other 0.12.x #96

Closed npfoss closed 5 years ago

npfoss commented 5 years ago

I just tried to update the ipfs npm package, and it bumped my version of peer-id from 0.12.2 to 0.12.3 (because many things in the ipfs tree rely on ~0.12.x or ^0.12.x), but then I started getting this error upon building with browserify:

Cannot find module 'babelify' from '/path/to/my/app/node_modules/ipfs/node_modules/peer-id/node_modules/async'

Could you please remove version 0.12.3 or replace it with something compatible with all the other packages asking for ~0.12.0?

Update:

Steps to reproduce the error:

package.json

{
  "scripts": {
    "build": "browserify index.js -o app.js -d"
  },
  "dependencies": {
    "browserify": "^16.3.0",
    "ipfs": "^0.36.4"
  }
}

index.js

require('ipfs');

run

npm install
npm run build

Also available to be cloned here: https://github.com/npfoss/js-ipfs-bug-code

npfoss commented 5 years ago

@jacobheun It looks like you have the power to fix this, could you please take a look?

alanshaw commented 5 years ago

This looks like it might be an issue with v3 of async https://github.com/caolan/async/issues/1653#issuecomment-509751609

npfoss commented 5 years ago

It totally was. Thank you! Sorry for the misdiagnosis @ peer-id team

jacobheun commented 5 years ago

I think I am going to go ahead and cut a new patch release to roll back to async 2.6. Since we're migrating to await we wont be using the package much longer and right now it's just going to add some bloat to the bundle size. I am just doing some local testing and then will look to release the patch in the 0.12 line.

alanshaw commented 5 years ago

@jacobheun multistream-select is also using async@3

jacobheun commented 5 years ago

@alanshaw yeah, noticed that last night when I was testing, I will roll the version back there as well.

jacobheun commented 5 years ago

Just closing the loop here, both peer-id (12.x) and multistream-select have had their async deps reverted