pouchdb-community / pouchdb-replication-stream

Replicate PouchDB/CouchDB databases with Node.js-style streams
Apache License 2.0
189 stars 58 forks source link

cannot find module 'pouchdb/extras/promise' #52

Closed schamp closed 8 years ago

schamp commented 8 years ago

Did a fresh npm install of this, and it complains as follows:

module.js:341
    throw err;
    ^

Error: Cannot find module 'pouchdb/extras/promise'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/aschamp/pace-dx/node_modules/pouchdb-replication-stream/lib/pouch-utils.js:3:15)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)

I seem to recall working through this on another pouchdb plugin module, but I can't recall, and for the life of me I cannot find it. I think the solution was fairly straightforward though.

I installed pouchdb with the 'pouchdb-node' package, since this is just for some commandline utils.

schamp commented 8 years ago

Here's that issue: https://github.com/nolanlawson/pouchdb-full-sync/issues/2

It involved updating the dependency, in this case, I'm not sure exactly how to do that.

Doing an npm install --save-dev pouchdb (instead of just pouchdb-node) seemed to get me past it. Is there some other dependency that should be listed for pouchdb-replication-stream that will make this work?

nolanlawson commented 8 years ago

Looks like the problem is that I forgot to include any dependency on pouchdb here and it's just implicitly grabbed from the user's node_modules. And no, pouchdb-node does not have extras, which is deprecated anyway.

The fix here is for pouchdb-replication-stream to be explicit about its PouchDB dependencies. I'll fix that.

nolanlawson commented 8 years ago

Fixed in 1.2.7