dominictarr / npmd

MIT License
450 stars 37 forks source link

crashes on install #23

Open ghost opened 10 years ago

ghost commented 10 years ago

To make the prettier npmd search results I had to delete my ~/.npmd and re-sync the new registry contents but now I'm getting this error whenever I try to install packages:

$ npmd install traverse
[ 'traverse' ]

/home/substack/projects/npmd/index.js:100
        if(err) throw err
                      ^
Error: range not found
    at expandError (/home/substack/projects/npmd/node_modules/multilevel/node_modules/rpc-stream/index.js:24:16)
    at Stream.<anonymous> (/home/substack/projects/npmd/node_modules/multilevel/node_modules/rpc-stream/index.js:35:28)
    at Stream.stream.write (/home/substack/projects/npmd/node_modules/through/index.js:26:11)
    at Stream.ondata (stream.js:38:26)
    at Stream.EventEmitter.emit (events.js:96:17)
    at Stream.module.exports.err (/home/substack/projects/npmd/node_modules/multilevel/node_modules/mux-demux/inject.js:61:14)
    at Stream.EventEmitter.emit (events.js:96:17)
    at Stream.exports.json.stream.emit (/home/substack/projects/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/stream-serializer/index.js:59:33)
    at Stream.module.exports.stream.write (/home/substack/projects/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/duplex/index.js:68:12)
    at parse (/home/substack/projects/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/stream-serializer/index.js:28:13)
DamonOehlman commented 10 years ago

+1 I'm seeing the same thing after try to use npmd for the first time :(

DamonOehlman commented 10 years ago

OK, interestingly I think this is only a problem before the repository has reached 100% sync status. Just tried again once the repo had fully synced and it worked without issue.

dominictarr commented 10 years ago

Hmm, so what is happening here is npmd is trying to resolve a module that it doesn't have yet.

I think the solution here would be to update level-couch-sync so that it can update out of order. So, if you try to install a module that you don't have yet, pull it immediately from the registry. those installs will be slow... and it won't keep automatically up to date, but it will work without waiting for the entire registry to sync.