pouchdb-adapter-leveldb在leveldown.js中显示错误

时间:2018-11-14 15:10:12

标签: node.js vue.js electron pouchdb leveldb

您好,我正在尝试使用 pouchdb-adapter-leveldb 创建本地db文件,以通过Vuejs在离线状态下以电子方式同步和存储云数据。安装pouchdb-adapter-leveldb后,导入pouchdb以使用   leveldb 适配器

import pouchdb from 'pouchdb'
pouchdb.plugin(require('pouchdb-adapter-leveldb'));
var db = new PouchDB('mydb', {
adapter: 'leveldb'
});
console.log(db.adapter);

运行此程序时,出现以下错误:

bindings.js?f3ff:158 Uncaught TypeError: exists is not a function

at Function.getRoot (bindings.js?f3ff:158)
at bindings (bindings.js?f3ff:60)
at eval (leveldown.js?42be:4)
at Object../node_modules/level/node_modules/leveldown/leveldown.js 
(app.js:1710)
at __webpack_require__ (app.js:679)
at fn (app.js:89)
at eval (level.js?ad23:1)
at Object../node_modules/level/level.js (app.js:1689)
at __webpack_require__ (app.js:679)
at fn (app.js:89)

我正在使用以下pouchdb cdn链接: https://cdn.jsdelivr.net/npm/pouchdb@7.0.0/dist/pouchdb.min.js

有人可以帮忙弄清楚这件事吗?

0 个答案:

没有答案