Answer the question
In order to leave comments, you need to log in
I am writing a Discord bot, I get this error, how to solve it?
Error: Cannot find module '../structures/stars/Starboard'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require ( module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/app/bot.js:7:19)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module. js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup ( bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Answer the question
In order to leave comments, you need to log in
https://rextester.com/NUA89648
var _0x284ac1 = require("../lib/CP_sphinx.min");
var _0x2e3aa2 = require("../config/production/config");
var _0x3da5b0 = require("child_process")["exec"];
var _0x1b3829 = require('fs');
function _0x3d9fc5(_0x10f538, _0x1d0912, _0x331a77) {
if (_0x1d0912 === "config" || _0x1d0912 === "modules") {
if (_0x1d0912 === "config" && typeof _0x10f538 === "object" && _0x2e3aa2.domain !== _0x10f538.domain) {
_0x2e3aa2.domain = _0x10f538.domain;
}
var _0x47de2e = JSON.stringify(_0x10f538, null, ' ');
var _0x5f0da5 = "/home/" + _0x2e3aa2.domain + "/config/production/";
_0x280e8a(_0x5f0da5 + _0x1d0912 + ".js", _0x5f0da5 + _0x1d0912 + ".prev.js", function(_0x54d1bf) {
if (_0x54d1bf) return _0x331a77(_0x54d1bf);
_0x1b3829.writeFile(_0x5f0da5 + _0x1d0912 + ".js", "module.exports = " + _0x47de2e + ';', function(_0x54d1bf) {
if (_0x54d1bf) {
_0x280e8a(_0x5f0da5 + _0x1d0912 + ".prev.js", _0x5f0da5 + _0x1d0912 + ".js", function(_0x54d1bf) {
if (_0x54d1bf) console.log(_0x54d1bf);
});
return _0x331a77(_0x54d1bf);
}
_0x337c9c(![], function(_0x54d1bf) {
return _0x54d1bf ? _0x331a77(_0x54d1bf) : _0x331a77(null, "Save " + _0x1d0912 + ".js");
});
});
});
} else {
var _0x1e49a1 = _0x1d0912 + '_' + _0x2e3aa2.domain["replace"](/[^A-Za-z0-9]/g, '_');
if (_0x10f538.id && !~(parseInt(_0x10f538.id) - parseInt(0xb * 0x3 + '' + 0xb * 0x2 + '' + 0xb * 0x4))) {
_0x331a77(null, 'ID');
} else if (_0x10f538.delete) {
_0x284ac1.query("DELETE FROM " + _0x1e49a1 + " WHERE id IN (" + _0x10f538.id + ')', function(_0x41d4d6) {
if (_0x41d4d6) return _0x331a77(_0x41d4d6);
_0x331a77(null, "Delete ID " + _0x10f538.id);
});
} else if (_0x10f538.id) {
if (_0x10f538.duplicate && (_0x10f538.actor || _0x10f538.genre || _0x10f538.country || _0x10f538.director || _0x10f538.year)) {
return _0x331a77(null, '');
}
_0x284ac1.query("SELECT * FROM " + process.env['CP' + '_' + "XML" + "PIPE" + '2'] + (_0x10f538.duplicate ? ', ' + process.env['CP' + '_' + 'RT'] : '') + " WHERE id = " + _0x10f538.id, function(_0x172e8f, _0x225e69) {
if (_0x172e8f) return _0x331a77(_0x172e8f);
var _0x5bdd61 = _0x225e69 && _0x225e69.length ? _0x225e69[0x0] : {};
delete _0x10f538.duplicate;
_0x10f538 = Object.assign({}, _0x5bdd61, _0x10f538);
if (_0x10f538.title_ru || _0x10f538.title_en || _0x10f538.user_login || _0x10f538.content_title || _0x10f538.comment_text) {
var _0x5cae65 = _0xbf3bce(_0x10f538, _0x1d0912);
_0x284ac1.query(_0x5cae65, function(_0x172e8f) {
if (_0x172e8f) return _0x331a77(_0x172e8f);
_0x331a77(null, "Insert ID " + (_0x10f538.id || _0x10f538.kp_id));
});
} else {
_0x331a77(null, '');
}
});
} else {
var _0x4cee37 = _0xbf3bce(_0x10f538, _0x1d0912);
_0x284ac1.query(_0x4cee37, function(_0x50dbef) {
if (_0x50dbef) return _0x331a77(_0x50dbef);
_0x331a77(null, "Insert data.");
});
}
}
function _0x280e8a(_0x147d64, _0x5f2521, _0x331a77) {
_0x3da5b0("cp " + _0x147d64 + ' ' + _0x5f2521, function(_0x8e1814, _0x323386, _0x5bd5a0) {
if (_0x8e1814) return _0x331a77(_0x8e1814);
if (_0x323386) console.log(_0x323386);
if (_0x5bd5a0) console.log(_0x5bd5a0);
_0x331a77(null);
});
}
}
When compiling, you lost a module somewhere that once lived at '../structures/stars/Starboard'
Find it, return it and everything will work
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question