Compoundjs无法使用jugglingdb-mysql运行

Man*_*ngh 5 mysql node.js compoundjs jugglingdb

试图用mysql测试compoundjs但它失败了.

我的系统是Debian 7,其中包含以下版本的nodejs和npm

$ node -v
v0.10.13

$ npm -v
1.3.4

这是我安装compoundjs的方法

sudo npm install -g compound
sudo npm install -g jugglingdb --save
sudo npm install -g jugglingdb-mysql

compound init testapp --db mysql
cd testapp
npm install
$ node server.js

WARNING: JugglingDB adapter "mysql" is not installed,
so your models would not work, to fix run:

    npm install jugglingdb-mysql


/srv/www/playground/node/testapp/node_modules/jugglingdb/lib/railway.js:55
        if (!schema.adapter) throw new Error('Adapter is not defined');
                                   ^
Error: Adapter is not defined
    at init (/srv/www/playground/node/testapp/node_modules/jugglingdb/lib/railway.js:55:36)
    at CompoundServer.initialize (/srv/www/playground/node/testapp/node_modules/jugglingdb/index.js:31:19)
    at CompoundServer.EventEmitter.emit (events.js:98:17)
    at CompoundServer.initCompound (/srv/www/playground/node/testapp/node_modules/compound/lib/compound.js:123:14)
    at CompoundServer.initCompoundServer [as init] (/srv/www/playground/node/testapp/node_modules/compound/lib/server/compound.js:53:29)
    at /srv/www/playground/node/testapp/node_modules/compound/lib/compound.js:67:18
    at process._tickCallback (node.js:415:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:901:3

在得到上面的错误后,我尝试了 npm install jugglingdb-mysql 仍然得到相同的错误.我尝试过全局和本地安装jugglingdb和jugglingdb-mysql(没有-g).我一直得到同样的错误.

Jih*_*hel 9

该漏洞是由于jugglingdb-的MySQL NPM存款使用的jugglingdb版本,所以要解决这个问题的唯一方法就是删除目录,并复制你在你的主要项目中使用的一个:

cd $YOUR_PROJECT_ROOT
rm -rf node_modules/jugglingdb-mysql/node_modules/jugglingdb
cp -R node_modules/jugglingdb node_modules/jugglingdb-mysql/node_modules
Run Code Online (Sandbox Code Playgroud)

我没有尝试从github手动安装适配器,也许它也有效.

这个问题在这里报告https://github.com/jugglingdb/mysql-adapter/issues/46