dominictarr / npmd

MIT License
450 stars 37 forks source link

Missing a package version in local metadata database #56

Open andreypopp opened 10 years ago

andreypopp commented 10 years ago

When I try to install deps of a local package npmd fails with error:

Error: package:react-app-server-runtime@0.1.0 could not resolve lodash@~2.4.1
no version of:lodash satified version:~2.4.1
expected one of:["0.1.0","0.2.0","0.2.1","0.2.2","0.3.0","0.3.1","0.3.2","0.4.0","0.4.1","0.4.2","0.5.0-rc.1","0.5.0","0.5.1","0.5.2","0.6.0","0.6.1","0.7.0","0.8.0","0.8.1","0.8.2","0.9.0","0.9.1","0.9.2","0.10.0","1.0.0-rc.3","1.0.0","1.0.1","1.1.0","1.1.1","1.2.0","1.2.1","1.3.0","1.3.1","2.0.0","2.1.0","2.2.0","2.2.1","2.3.0","2.4.0"]

While npmd --sync says it is synced up to 100% and npm info lodash lists 2.4.1 version as available.

I suspect a failure in sync between npm registry and local metadata database

P.S. npmd is awesome, thanks!

dominictarr commented 10 years ago

hmm, sounds like it. what if you restart the sync process?

hmm, the trouble with sync percentage is that there are so many update that two decimal places isn't enough. the progress bar is good on the initial sync, but if you have been offline for several days, there will stiff be modules to sync, and it might be down to 99.7%

Although, I suspect the reconnecting logic in follow. Did restarting it work?

dominictarr commented 10 years ago

also: TODO npmd sync to update a specific module.

andreypopp commented 10 years ago

hmm, sounds like it. what if you restart the sync process?

The same.

Although, I suspect the reconnecting logic in follow. Did restarting it work?

Nope, but I after I removed ~/.npmd and synced from the scratch it works now.

lodash 2.4.1 was released 2013-12-03 so I guess this is not because of lag in sync. Maybe there's some inconsistency in handling sync, can it mark some keys as synced while they weren't properly synced? Sadly, as I see, there's no checksum mechanism in CouchDB sync protocol.

dominictarr commented 10 years ago

Damn, that is strange. I took some care ensure that problems like this can't happen. But it looks like something has slipped through. The way this works will change in npmd@1, so which will avoid this problem, or at least allow you to work around it.

balupton commented 10 years ago

Just installed npmd on my laptop, ran npmd --sync, it's on 100% on the top bar, and 99.40% on the bottom bar.

Then in another terminal I ran this and got an error:

$ npmd install

/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/index.js:105
        if(err) throw err
                      ^
Error: package.json can not be located
    at expandError (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/rpc-stream/index.js:24:16)
    at Stream.<anonymous> (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/rpc-stream/index.js:35:28)
    at Stream.stream.write (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/through/index.js:26:11)
    at Stream.ondata (stream.js:51:26)
    at Stream.EventEmitter.emit (events.js:95:17)
    at Stream.<anonymous> (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/mux-demux/inject.js:61:14)
    at Stream.EventEmitter.emit (events.js:95:17)
    at Stream.stream.emit (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/stream-serializer/index.js:60:33)
    at Stream.stream.write (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/duplex/index.js:68:12)
    at parse (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/stream-serializer/index.js:29:13)
22:56:17:balupton@balair.local:/Users/balupton/Projects/inlinegui:master
$ npmd install --greedy

/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/index.js:105
        if(err) throw err
                      ^
Error: package.json can not be located
    at expandError (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/rpc-stream/index.js:24:16)
    at Stream.<anonymous> (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/rpc-stream/index.js:35:28)
    at Stream.stream.write (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/through/index.js:26:11)
    at Stream.ondata (stream.js:51:26)
    at Stream.EventEmitter.emit (events.js:95:17)
    at Stream.<anonymous> (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/mux-demux/inject.js:61:14)
    at Stream.EventEmitter.emit (events.js:95:17)
    at Stream.stream.emit (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/stream-serializer/index.js:60:33)
    at Stream.stream.write (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/duplex/index.js:68:12)
    at parse (/Users/balupton/.nvm/v0.10.23/lib/node_modules/npmd/node_modules/multilevel/node_modules/mux-demux/node_modules/stream-serializer/index.js:29:13)
dominictarr commented 10 years ago

is there a package.json in your current directory?