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β€’10mo 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.
Fayne 🌈🐱 (fka Ruin 🌈🐲)
I don't have pieces in my package.json. just "@sapphire/framework": "^5.2.1"
kyra
kyraβ€’10mo ago
It’s a dependency of framework, by default it should install the latest version, unless it’s cached
Fayne 🌈🐱 (fka Ruin 🌈🐲)
oh wait. should i delete my pnpm store then?
kyra
kyraβ€’10mo ago
Probably, but you can try deleting node_modules and installing fresh
Fayne 🌈🐱 (fka Ruin 🌈🐲)
The only thing is it does work with pnpm start
kyra
kyraβ€’10mo 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
Fayne 🌈🐱 (fka Ruin 🌈🐲)
πŸ‘Œ oh nvm, deleting and recreating node_modules fixed it no it didn't i just forgot to recreate the PM2 entry
MRDGH2821
MRDGH2821β€’10mo ago
PM2 should be running the command pnpm start Wait this doesn't seem to be relevant to question. My bad πŸ˜…
Favna
Favnaβ€’10mo 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 🌈🐲
Fayne 🌈🐱 (fka Ruin 🌈🐲)
that stops the interpreter parameter from working.
Favna
Favnaβ€’10mo ago
Is that a problem? Isn't node 20 your global default?
Fayne 🌈🐱 (fka Ruin 🌈🐲)
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β€’10mo ago
so if you run which node it doesnt point to nvm node?
Fayne 🌈🐱 (fka Ruin 🌈🐲)
it does, but pm2 is running on system node
UndiedGFX
UndiedGFXβ€’10mo ago
pm2 start script.js --interpreter=fullpath replace fullpath to the nvm's node
Fayne 🌈🐱 (fka Ruin 🌈🐲)
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β€’10mo ago
hmm

Did you find this page helpful?