We have installed the mysql module using npm install mysql and restarted the cwmp service. Our ext script is not able to run the module.
Channel has faulted; channel=“boot” retries=0 faultCode=“ext.Error” faultMessage=“Cannot find module ‘mysql’\nRequire stack:\n- /opt/genieacs/ext/cpe-config.js\n- /usr/lib/node_modules/genieacs/bin/genieacs-ext”
var mysql = require('mysql');
var con = mysql.createConnection({
host: "host",
user: "user",
password: "password",
database: "database"
});
function DB(args, callback) {
let mac = args[0];
con.connect(function(err) {
if (err) throw err;
con.query('SELECT * FROM acs WHERE mac = ' + mysql.escape(mac), function (err, result, fields) {
if (err) throw err;
console.log(result[0]);
return callback(null, results[0]);
});
});
}
exports.DB = DB;