PM2 issues

Hello. I'm trying to use PM2 (installed globally) with NVM and I'm having trouble getting it to work. Any idea what I might be doing wrong? Is it because of TSX?
No description
18 Replies
kyra
kyraβ€’6mo ago
If you’re on latest version (aka have @sapphire/pieces installed at 4.3.1, which is latest as of writing), it should load files correctly. Otherwise try updating using the instructions for the package manager you use.
Ruin 🌈🐲
Ruin 🌈🐲OPβ€’6mo ago
I don't have pieces in my package.json. just "@sapphire/framework": "^5.2.1"
kyra
kyraβ€’6mo ago
It’s a dependency of framework, by default it should install the latest version, unless it’s cached
Ruin 🌈🐲
Ruin 🌈🐲OPβ€’6mo ago
oh wait. should i delete my pnpm store then?
kyra
kyraβ€’6mo ago
Probably, but you can try deleting node_modules and installing fresh
Ruin 🌈🐲
Ruin 🌈🐲OPβ€’6mo ago
The only thing is it does work with pnpm start
kyra
kyraβ€’6mo ago
Oh, it does work with that, but not in pm2 It should be fine, weird I can check tomorrow, see if there’s a solution
Ruin 🌈🐲
Ruin 🌈🐲OPβ€’6mo ago
πŸ‘Œ oh nvm, deleting and recreating node_modules fixed it no it didn't i just forgot to recreate the PM2 entry
MRDGH2821
MRDGH2821β€’6mo ago
PM2 should be running the command pnpm start Wait this doesn't seem to be relevant to question. My bad πŸ˜…
Favna
Favnaβ€’6mo ago
This might very well be because of tsx yes. I think you can indeed make pm2 run pnpm start, that might fix it @Ruin 🌈🐲
Ruin 🌈🐲
Ruin 🌈🐲OPβ€’6mo ago
that stops the interpreter parameter from working.
Favna
Favnaβ€’6mo ago
Is that a problem? Isn't node 20 your global default?
Ruin 🌈🐲
Ruin 🌈🐲OPβ€’6mo ago
the system node is outside of my control. i'm not the admin and i don't want to bug the admin any time i update node.
Favna
Favnaβ€’6mo ago
so if you run which node it doesnt point to nvm node?
Ruin 🌈🐲
Ruin 🌈🐲OPβ€’6mo ago
it does, but pm2 is running on system node
UndiedGFX
UndiedGFXβ€’6mo ago
pm2 start script.js --interpreter=fullpath replace fullpath to the nvm's node
Ruin 🌈🐲
Ruin 🌈🐲OPβ€’6mo ago
Isn't that exactly what I'm doing in the ecosystem config, where Sapphire finds 0 commands? https://discord.com/channels/737141877803057244/1260366633482846270/1260366633482846270
UndiedGFX
UndiedGFXβ€’6mo ago
hmm
Want results from more Discord servers?
Add your server