# Cursor not using bun

**URL:** <https://forum.cursor.com/t/cursor-not-using-bun/165946>\
**Category:** Bug Reports\
**Tags:** terminal, linux\
**Created:** [July 16, 2026, 6:36pm UTC](https://forum.cursor.com/t/cursor-not-using-bun/165946 "2026-07-16T18:36:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsurg.com](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tsurg.com/32/114838_2.png) [@Tsurg.com](https://forum.cursor.com/u/Tsurg.com)\
**Post date:** [July 16, 2026, 6:36pm UTC](https://forum.cursor.com/t/cursor-not-using-bun/165946/1 "2026-07-16T18:36:45Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

The cursor agent seems to not be able to use bun ([bun.com](http://bun.com)). It fallbacks to manually exporting it to PATH every time.

### Steps to Reproduce

Install ubuntu 26.04 (also tested on fedora & arch linux)  
Install bun with their install script  
Install cursor  
Verify that bun is in path in ~/.bashrc

```bash
$ cat ~/.bashrc | grep bun

```

response:

```bash
# bun
export BUN_INSTALL="$HOME/.bun"

```

Use bun package manager in project  
Start agent  
Agent is not able to use bun directly by running `bun`

### Expected Behavior

agent should be able to call the `bun` command

### Screenshots / Screen Recordings

 ![Screenshot From 2026-07-16 19-30-37.png](https://us1.discourse-cdn.com/cursor1/original/3X/7/2/727fd3a55ab83799c7e2f6ea0cd83d9b84433e09.png)

### Operating System

Linux

### Version Information

Newest version, in both vscode ide and new app

### For AI issues: which model did you use?

Any model

### Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [July 17, 2026, 5:06am UTC](https://forum.cursor.com/t/cursor-not-using-bun/165946/5 "2026-07-17T05:06:45Z")

</div>

Hey, thanks for the detailed report. This isn’t exactly a bug, it’s how the environment gets picked up.

When Cursor is launched from the GUI (desktop icon), it resolves the environment via a `login shell`. A login bash reads `/etc/profile`, `~/.bash_profile`, `~/.bash_login`, and `~/.profile`, but it does not read `~/.bashrc`. The bun installer puts `BUN_INSTALL`/`PATH` into `~/.bashrc`, so the agent can’t see `bun` and falls back to a manual `export` before each command (which is what you see in the screenshot). The integrated terminal works because it starts as non-login and sources `~/.bashrc`.

Any of these options should fix it:

1. Add bun to a file that a login shell reads, like `~/.profile` (or `~/.bash_profile`):

```bash
   export BUN_INSTALL="$HOME/.bun"
   export PATH="$BUN_INSTALL/bin:$PATH"

```

Or add ⁠source `~/.bashrc` to `⁠~/.bash_profile`. Then fully restart Cursor.  
2. Launch Cursor from a terminal where bun is already in ⁠PATH, e.g. ⁠cursor ., so it inherits your shell ⁠PATH. 3. Or set it in Settings: ⁠`terminal.integrated.env.linux` → `⁠PATH` = `${env:HOME}/.bun/bin:${env:PATH}` and restart.

Let me know if it still doesn’t work.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [August 16, 2026, 5:07am UTC](https://forum.cursor.com/t/cursor-not-using-bun/165946/6 "2026-08-16T05:07:26Z")

</div>

Closed on August 16, 2026, 5:07am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
