Open cryptomaxsun opened 1 week ago
make toISOString defined
you have to convert your code to es module to import es modules. otherwise you have to asynchronously use the module after it is loaded.
import("dateformat").then(({default: dateFormat}) => {
// use dateFormat here
});
node init.js
/home/max/pool/lib/exceptionWriter.js:22
let time = dateFormat(toISOString defined(), 'yyyy-mm-dd HH:MM:ss');
^^^^^^^^^^^
SyntaxError: missing ) after argument list
exceptionWriter.js:22
/**
* Cryptonote Node.JS Pool
* https://github.com/dvandal/cryptonote-nodejs-pool
*
* Exception writer
**/
// Load required modules
let fs = require('fs');
let cluster = require('cluster');
let dateFormat;
import("dateformat").then(({default: dateFormat}) => {
// use dateFormat here
});
/**
* Handle exceptions
**/
module.exports = function (logSystem) {
process.on('uncaughtException', function (err) {
console.log('\n' + err.stack + '\n');
let time = dateFormat(toISOString defined(), 'yyyy-mm-dd HH:MM:ss');
fs.appendFile(config.logging.files.directory + '/' + logSystem + '_crash.log', time + '\n' + err.stack + '\n\n', function (err) {
if (cluster.isWorker)
process.exit();
});
});
};
What's wrong now?
🗿
Well it looks like you are trying to run someone else's module so you shouldn't have to be modifying the code. It looks like you have wrong version of dateformat module.
This is wrong. Do not use npm update
. Use npm install
. Then it will install dateformat 4.5.1 as specified in package.json and it should work. Otherwise it installs latest version which is not compatible.
no clone the repo again and start over
I did as you said, now this problem.
Why are statistics not displayed when the pool is running?
Help me, please!
Did you find a solution?
Did you find a solution?
No
I got an error when starting the pool
corrected in the file in logger.js
Starting a pool
How can this be fixed?