Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Fails on .init() #755

Closed
nicola opened this issue Feb 2, 2017 · 5 comments
Closed

Fails on .init() #755

nicola opened this issue Feb 2, 2017 · 5 comments

Comments

@nicola
Copy link
Member

nicola commented Feb 2, 2017

The npm version crashes on init with the error below, however, after I have retrieved js-ipfs from github and npm-linked it worked again.

I have this code:

const IPFS = require('ipfs')

const node = new IPFS({
  repo: '/tmp/test',
  EXPERIMENTAL: {
    pubsub: false
  }
})

node.init({ emptyRepo: true, bits: 2048 }, (err) => {
   if (err) { throw err }
})

And when running it, this is what I get:

Secp256k1 bindings are not compiled. Pure JS implementation will be used.
/Users/mozilla/Proj/gits/js-ipld-selector/node_modules/ipfs/src/core/components/init.js:30
      (cb) => self._repo.exists(cb),
                         ^

TypeError: self._repo.exists is not a function
    at waterfall (/Users/mozilla/Proj/gits/js-ipld-selector/node_modules/ipfs/src/core/components/init.js:30:26)
    at nextTask (/Users/mozilla/Proj/gits/js-ipld-selector/node_modules/async/waterfall.js:28:14)
    at exports.default (/Users/mozilla/Proj/gits/js-ipld-selector/node_modules/async/waterfall.js:31:5)
    at IPFS.init (/Users/mozilla/Proj/gits/js-ipld-selector/node_modules/ipfs/src/core/components/init.js:28:5)
    at Object.<anonymous> (/Users/mozilla/Proj/gits/js-ipld-selector/basic.js:10:6)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

Am I doing something wrong?

@daviddias
Copy link
Member

Not at all, this is an issue because of our abuse of minor versions (pre 1.0.0). Took a note here ipfs/community#225 (comment) and will add this as an item of the 0.22 release.

Thank you for catching and reporting this @nicola (I'm afraid it must be annoying a ton of people)

@dignifiedquire
Copy link
Member

@diasdavid which dependency chain here is breaking? I can do a dependency freeze and push a bug fix release if you want

@daviddias
Copy link
Member

@dignifiedquire let's just go full ~ as we have discussed and agreed and January and remove the issue at the root, otherwise it will be very hard to tell which dep is causing the breaking (plus freazing that one my break others). Do note that in master it is fine.

@daviddias daviddias mentioned this issue Feb 7, 2017
22 tasks
@nicola
Copy link
Member Author

nicola commented Feb 8, 2017

Thank you :)

@daviddias daviddias added the status/ready Ready to be worked label Feb 10, 2017
@daviddias
Copy link
Member

This is not a problem anymore since 0.22, since we moved all our below 1.x.x deps to use ~ instead of ^.

Thanks for the report @nicola

@daviddias daviddias removed the status/ready Ready to be worked label Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants