Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compoundjs fails to run with jugglingdb-mysql

Trying to test compoundjs with mysql but it fails.

My system is Debian 7 with following versions of nodejs & npm

$ node -v
v0.10.13

$ npm -v
1.3.4

Here is how I installed 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

After getting the error above I tried npm install jugglingdb-mysql I still get the same error. I have tried installing jugglingdb and jugglingdb-mysql globally and locally (without -g). I keep getting the same error.

like image 738
Manraj Singh Avatar asked Jul 12 '13 22:07

Manraj Singh


1 Answers

The bug is due to the jugglingdb version used in the npm deposit of jugglingdb-mysql, so the only way to fix it is to delete the directory and copy the one you use in your main project :

cd $YOUR_PROJECT_ROOT
rm -rf node_modules/jugglingdb-mysql/node_modules/jugglingdb
cp -R node_modules/jugglingdb node_modules/jugglingdb-mysql/node_modules

I haven't tries to install the adapter manually from github, maybe it works too.

The problem is reported here https://github.com/jugglingdb/mysql-adapter/issues/46

like image 114
Jihel Avatar answered Oct 31 '22 04:10

Jihel