node-mariasql icon indicating copy to clipboard operation
node-mariasql copied to clipboard

Node.js to Mariadb10.1

Open s390 opened this issue 10 years ago • 7 comments

trying to use node.js with Mariadb10.1 and I get following error when I run sample program

Program //test ivp var Client = require('mariasql');

var c = new Client({ host: '172.17.0.40', user: 'foot', password: 'foo123' });

c.query('SHOW DATABASES', function(err, rows) { if (err) throw err; console.dir(rows); });

c.end();

:/rakesh # node mariaivp.js

module.js:340 throw err; ^ Error: Cannot find module '../build/Debug/sqlclient' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/node_modules/mariasql/lib/Client.js:13:11) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

s390 avatar Nov 28 '15 15:11 s390

How did you install? Were there any compiler errors?

mscdex avatar Nov 28 '15 16:11 mscdex

I git cloned and copied the folder to nod_modules as mariasql folder. I couldn't find any errors

s390 avatar Nov 28 '15 18:11 s390

If you did that, you didn't actually build the addon. You should be able to just npm install mariasql which will download and build the addon for you. Otherwise you have to change to the addon directory (and assuming you have already installed node-gyp globally) and do node-gyp rebuild to build the addon manually.

mscdex avatar Nov 28 '15 18:11 mscdex

:/rakesh # node mariaivp.js

/node_modules/mariasql/lib/Client.js:34 this._handle = new binding({ ^ Error: The async interface is not currently supported on your platform. at new Client (/node_modules/mariasql/lib/Client.js:34:18) at Object. (/rakesh/mariaivp.js:4:9) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:935:3 :/rakesh #

I am getting the above error after I built using the node-gyp as mentioned below and when I ran the program.

s390 avatar Nov 30 '15 10:11 s390

What OS/platform are you using and what node version?

mscdex avatar Nov 30 '15 16:11 mscdex

I am running this on s390 platform (z system) with SLES12 as OS Node version v0.12.7

s390 avatar Nov 30 '15 17:11 s390

Ah ok, I'm not very familiar with that platform. Assuming this is similar to the case with ARM, do you have a ucontext.h in your /usr/include somewhere?

mscdex avatar Nov 30 '15 18:11 mscdex