Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Accessing non-existent property 'cat' of module exports inside circular dependency #59

Open
nshah14285 opened this issue Sep 14, 2023 · 1 comment

Comments

@nshah14285
Copy link

nshah14285 commented Sep 14, 2023

$ 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.

@johndegey
Copy link

if using nvm, it would be under your home directory
ex: .nvm/versions/node/v18.18.0/lib/node_modules/pm2-zabbix

(don't forget to run npm install from that directory)

@nshah14285 : thanks for this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants