After installing the plugin, when I try to start Haraka I get this error:
[INFO] [-] [plugins] loading accounting-files
[CRIT] [-] [plugins] compiling 'accounting-files' failed
[CRIT] [-] [core] node_modules/haraka-plugin-accounting-files/index.js:8
[CRIT] [-] [core] var dateFormat = require('dateformat');\r
[CRIT] [-] [core] ^
[CRIT] [-] [core]
[CRIT] [-] [core] Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/dateformat/lib/dateformat.js from node_modules/haraka-plugin-accounting-files/index.js not supported.
[CRIT] [-] [core] Instead change the require of dateformat.js in node_modules/haraka-plugin-accounting-files/index.js to a dynamic import() which is available in all CommonJS modules.
[CRIT] [-] [core] at Object. (node_modules/haraka-plugin-accounting-files/index.js:8:19)
I fixed it installing the last version of dateformat that supports CommonJS require, 4.6.3
After installing the plugin, when I try to start Haraka I get this error: [INFO] [-] [plugins] loading accounting-files [CRIT] [-] [plugins] compiling 'accounting-files' failed [CRIT] [-] [core] node_modules/haraka-plugin-accounting-files/index.js:8 [CRIT] [-] [core] var dateFormat = require('dateformat');\r [CRIT] [-] [core] ^ [CRIT] [-] [core] [CRIT] [-] [core] Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/dateformat/lib/dateformat.js from node_modules/haraka-plugin-accounting-files/index.js not supported. [CRIT] [-] [core] Instead change the require of dateformat.js in node_modules/haraka-plugin-accounting-files/index.js to a dynamic import() which is available in all CommonJS modules. [CRIT] [-] [core] at Object. (node_modules/haraka-plugin-accounting-files/index.js:8:19)
I fixed it installing the last version of dateformat that supports CommonJS require, 4.6.3