$ pm2-zabbix --discover
(node:2227425) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
at emitCircularRequireWarning (node:internal/modules/cjs/loader:834:11)
at Object.get (node:internal/modules/cjs/loader:850:5)
at Object._register [as register] (/usr/lib/node_modules/pm2-zabbix/node_modules/shelljs/src/common.js:455:12)
at Object. (/usr/lib/node_modules/pm2-zabbix/node_modules/shelljs/src/cat.js:4:8)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
Version details:
PM2 version 5.3.0
pm2-zabbix 0.3.2
Node v18.16.0
Ubuntu 20.04.1 LTS
Fix
open package.json file from pm2-zabbix folder (/usr/lib/node_modules/pm2-zabbix/)
Replace pm2 version "^2.1.0" with the installed version "^5.3.0". In my case pm2 version installed is 5.3.0.
Add shelljs with version "^0.8.5".
For eg. package.json looks like
"pm2": "^5.3.0",
"shelljs": "^0.8.5",
Update package.json file with above values to fix the issue.
$ pm2-zabbix --discover (node:2227425) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency at emitCircularRequireWarning (node:internal/modules/cjs/loader:834:11) at Object.get (node:internal/modules/cjs/loader:850:5) at Object._register [as register] (/usr/lib/node_modules/pm2-zabbix/node_modules/shelljs/src/common.js:455:12) at Object. (/usr/lib/node_modules/pm2-zabbix/node_modules/shelljs/src/cat.js:4:8)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
Version details: PM2 version 5.3.0 pm2-zabbix 0.3.2 Node v18.16.0 Ubuntu 20.04.1 LTS
Fix open package.json file from pm2-zabbix folder (/usr/lib/node_modules/pm2-zabbix/) Replace pm2 version "^2.1.0" with the installed version "^5.3.0". In my case pm2 version installed is 5.3.0. Add shelljs with version "^0.8.5".
For eg. package.json looks like
Update package.json file with above values to fix the issue.