pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

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

Open psm-solution-group opened this issue 1 year ago • 17 comments

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

psm-solution-group avatar Jan 26 '24 18:01 psm-solution-group

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

alexmacarthur avatar Jan 28 '24 19:01 alexmacarthur

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.

riteshakya037 avatar Jan 31 '24 08:01 riteshakya037

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

sciotta avatar Feb 08 '24 23:02 sciotta

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

justinherrera avatar Feb 18 '24 11:02 justinherrera

This solved my case:

sudo npm install -g bun

SaariTech avatar Feb 25 '24 01:02 SaariTech

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)

devtempmac avatar Feb 28 '24 07:02 devtempmac

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.

kukovecd-krtech avatar Mar 26 '24 20:03 kukovecd-krtech

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?

divmgl avatar May 10 '24 21:05 divmgl

This solved my case:

sudo npm install -g bun

Yeah, this works for me as well.

vikaskumar2500 avatar May 30 '24 07:05 vikaskumar2500

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

gabboman avatar Jun 01 '24 08:06 gabboman

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

gabboman avatar Jun 01 '24 08:06 gabboman

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

cit-gif avatar Jun 22 '24 18:06 cit-gif

This solved my case:

sudo npm install -g bun

Also working for me. Thanks a lot.

clementolive avatar Jul 31 '24 07:07 clementolive

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.

gabboman avatar Jul 31 '24 10:07 gabboman

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

ddnazzah avatar Aug 14 '24 06:08 ddnazzah