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?
18 Replies
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.I don't have pieces in my package.json. just
"@sapphire/framework": "^5.2.1"
Itβs a dependency of framework, by default it should install the latest version, unless itβs cached
oh wait.
should i delete my pnpm store then?Probably, but you can try deleting node_modules and installing fresh
The only thing is it does work with
pnpm start
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
π
oh nvm, deleting and recreating node_modules fixed it
no it didn't i just forgot to recreate the PM2 entry
PM2 should be running the command
pnpm start
Wait this doesn't seem to be relevant to question. My bad π
This might very well be because of tsx yes. I think you can indeed make pm2 run pnpm start, that might fix it @Ruin ππ²
that stops the interpreter parameter from working.
Is that a problem?
Isn't node 20 your global default?
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.
so if you run
which node
it doesnt point to nvm node?it does, but pm2 is running on system node
pm2 start script.js --interpreter=fullpath
replace fullpath to the nvm's node
Isn't that exactly what I'm doing in the ecosystem config, where Sapphire finds 0 commands?
https://discord.com/channels/737141877803057244/1260366633482846270/1260366633482846270
hmm