Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.45k stars 2.62k forks source link

[PM2][ERROR] Error: Interpreter bun is NOT AVAILABLE in PATH. (type 'which bun' to double check.) #5751

Open psm-solution-group opened 8 months ago

psm-solution-group commented 8 months ago

What's going wrong?

Hello,

I got this error:

[PM2][ERROR] Error: Interpreter bun is NOT AVAILABLE in PATH. (type 'which bun' to double check.)

I use nodejs + express + typescript and run this code: pm2 start src/server.ts --watch

alexmacarthur commented 8 months ago

I had the same issue when using a configuration file to specify the interpreter, but it went away when I either explicitly specified my root path (not just use "~"), or by passing it in the command:

pm2 start --interpreter ~/.bun/bin/bun src/main.ts
riteshakya037 commented 8 months ago

I had the same issue don't know why they switched to bun in 5.3.1 a patch update. Had to use specific to 5.3.0 version. Production was down for 3 hrs thanks to this.

sciotta commented 8 months ago

Make no sense this migration. At least i think it's a major change.

justinherrera commented 8 months ago

bun is still experimental on windows at this time, but this works on a windows machine

pm2 start --interpreter C:\Users\your-name.bun\bin\bun.exe index.ts

SaariTech commented 8 months ago

This solved my case:

sudo npm install -g bun

devtempmac commented 7 months ago

This solved my case:

sudo npm install -g bun

yes that could work for some cases...

but in my case, with some require main checks to differentiate code execution path between run-as-lib vs run-directly, bun isn't an option...

bun isn't a drop-in-replacement as it proclaims... And changing default behavior just for some benchmarks is just ridiculous

instead, pm2 should have printed a suggestion ("your nodejs app will run faster with --use-bun option")

Or at least, pm2 should give an option to use the old default way of running *.ts files (eg. --use-old-tsnodeor --use-node-interpreter)

kukovecd-krtech commented 6 months ago

This solved my case:

sudo npm install -g bun

Saved me a lot of time. Sad to see this hapening in this version, hope they come up with a fix for this soon.

divmgl commented 5 months ago

This is so unbelievably ridiculous. I could recognize that it was using Bun under the hood because our app started crashing with dyld[89932]: missing symbol called, which is happening exclusively in Bun. Why would such a major change be done in a patch update?

vikaskumar2500 commented 4 months ago

This solved my case:

sudo npm install -g bun

Yeah, this works for me as well.

gabboman commented 4 months ago

no way of using ts-node ? my app is not compatible with bun

gabboman commented 4 months ago

[EDIT] I could do the thing with this command pm2 start --interpreter ts-node --name NAME index.ts

cit-gif commented 4 months ago

This solved my case: pm2 start pm2.config.js --interpreter ~/.bun/bin/bun

clementolive commented 2 months ago

This solved my case:

sudo npm install -g bun

Also working for me. Thanks a lot.

gabboman commented 2 months ago

This solved my case: sudo npm install -g bun

Also working for me. Thanks a lot.

bun is not compatible with a lot of projects and/or can fail silently.

ddnazzah commented 2 months ago

I simply typed type which bun in the terminal and used that path in place of ~/.bun/bin/bun

b1n1yam commented 1 month ago

To set the path for PM2, after retrieving the path from which bun, use the commandsudo pm2 start index.ts --interpreter /your/path/to/bun

lucksp commented 2 weeks ago

which bun results in:

bun not found

So why is bun not a dependency of pm2?