Getting error while running node-mysql tutorial

I am running the code in the tutorial part of node-mysql and its giving me error **Code** var MySQLPool = require("mysql-pool").MySQLPool; var pool = new MySQLPool({ poolSize: 4, user: 'root', password: 'root', database: 'test' }); pool.query("SELECT 'Hello, World!' AS hello", function(err, rows, fields) { if(err) throw err; console.log(rows[0].hello); }); for(var i = 0; i < 10; ++i) { pool.query("SELECT SLEEP(2), ? AS i", [i], function(err, rows, fields) { if(err) throw err; console.log("Slept: " + rows[0].i); }); } **ERROR:** > /home/comapq/Works/Nodejs/Codes/node_modules/mysql-pool/lib/mysql-pool/pool.js:158 > for(var key in Client.prototype) { > ^ > TypeError: Cannot read property 'prototype' of undefined > at MySQLPool._populate (/home/comapq/Works/Nodejs/Codes/node_modules/mysql-pool/lib/mysql-pool/pool.js:158:23) > at new MySQLPool (/home/comapq/Works/Nodejs/Codes/node_modules/mysql-pool/lib/mysql-pool/pool.js:44:7) > at Object. (/home/comapq/Works/Nodejs/Codes/test-mysql-3.js:2:12) > at Module._compile (module.js:449:26) > at Object.Module._extensions..js (module.js:467:10) > at Module.load (module.js:356:32) > at Function.Module._load (module.js:312:12) > at Module.runMain (module.js:492:10) > at process.startup.processNextTick.process._tickCallback (node.js:244:9)

以上就是Getting error while running node-mysql tutorial的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » Node.js答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏