multiformats / js-multihashing

Use all the functions in multihash.
MIT License
11 stars 18 forks source link

v0.2.2 can't be required from node #18

Closed yusefnapora closed 7 years ago

yusefnapora commented 7 years ago

I'm getting the following with node 6.9.5, npm 3.10.10

$ npm install --save multihashing@0.2.2
$ node
> require('multihashing')
Error: Cannot find module 'multihashing'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at repl:1:1
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:346:29)
    at bound (domain.js:280:14)

Requiring the index file works:

> require('./node_modules/multihashing/src/index')
{ [Function: Multihashing]
 // ... etc
 }

package.json has lib/index.js as the "main" entrypoint, but the lib dir doesn't exist in the published module. dist exists, but requiring dist/index.js just returns an empty object.

dignifiedquire commented 7 years ago

@diasdavid we really should deprecate this module...

@yusefnapora if you can please try and transition to js-multihashing-async which is what we use internally and is much better tested and feature ready.

dignifiedquire commented 7 years ago

the actual issue here is that aegir was updated and the package.json wasn't afjusted for the changed build locations

yusefnapora commented 7 years ago

Right on; looking through our code, it looks like there's only one place we're actually using it from a synchronous function, and that's not too hard to work around.

daviddias commented 7 years ago

@yusefnapora auch, apologies about that, that was because of a old aegir version was still being used. Now fixed with 0.2.3. Thanks for the report!

yusefnapora commented 7 years ago

No worries, glad I could help.