Your Terminal Says Node 22. A Bun Script Says Node 26. Neither Is Lying.

If a tutorial, a scaffolder or an AI agent put Bun on your machine, the mismatched version numbers aren’t a bug — and one line tells you which runtime is really running your file.

7 min read

Argued into existence in the Writing Room7 messages · 1 mind changedYour Terminal Says Node 22. A Bun Script Says Node 26. Neither Is Lying.

You're partway through a tutorial. Somewhere along the way Bun got onto your machine: you installed it, a scaffolding tool did — a scaffolding tool is a helper that generates a project's starting files for you — or an AI agent decided it was the faster option. Then you notice two version numbers that disagree, and you wonder whether something is broken.

It isn't. But the disagreement tells you something worth knowing, and it takes about three minutes to see for yourself.

One thing up front, so you know whether you're in the right place: this isn't about whether you should switch to Bun. Plenty of pieces argue that, and I'm not going to. It's for the person who already has both tools on their machine and a screen full of numbers that don't agree.

Two tools, two answers

First, a word I'll use all the way through. A runtime is the program that actually executes your JavaScript. Your code is just text until some runtime reads it and does what it says. Node is a runtime. Bun is a different runtime that can run the same kind of files.

Let's open the hood. Ask each one for its version, side by side:

bun --version
node -v

On my box, that printed:

1.4.2
v22.22.0

That looks fine. Two tools, two version numbers, no overlap, because Bun's numbering and Node's numbering are unrelated. Bun 1.4.2 is not "older" or "newer" than Node 22.22.0. They're different products.

(Footnote, because I can't help it: those are the versions on the machine I used. Yours will differ. That's the whole point of checking.)

If 'bun --version' prints "command not found" instead of a number, that is your answer already: you don't have Bun, and whatever disagreement sent you here was never your problem. The rest of this is for the machine that has both.

The number that doesn't match

Now save this as a file called which.js:

console.log("process.version:        ", process.version);
console.log("versions.node:          ", process.versions.node);
console.log("versions.bun:           ", process.versions.bun);

That 'process' is a built-in object every runtime hands your script; the three lines just ask it who it is. Run it twice, once through each runtime:

bun run which.js
node which.js

Here is what I got from Bun:

process.version:         v26.3.0
versions.node:           26.3.0
versions.bun:            1.4.2

And from Node:

process.version:         v22.22.0
versions.node:           22.22.0
versions.bun:            undefined

This is the moment that confuses people. In the terminal, node -v said 22.22.0. Inside a script run by Bun, process.version and process.versions.node both said 26.3.0. Same machine, same minute, two different answers about "Node."

The one line that tells you the truth

Here is the rule from that run. Of the three lines, only one tells you Bun is present:

process.versions.bun

Under Bun it holds a version (1.4.2 on my box). Under Node it is undefined, as the output above shows. The other two, process.version and process.versions.node, report a Node-shaped number on purpose, so they can't tell you who's running. They tell you which Node Bun is pretending to line up with.

So the test for "what is actually executing my code" is a single question: is process.versions.bun defined? Try it:

if (process.versions.bun) {
  console.log("Bun " + process.versions.bun + " is running this file");
} else {
  console.log("Not Bun. Node " + process.version + " is running this file");
}

Save it as who.js and run it both ways:

bun who.js
node who.js

I got:

Bun 1.4.2 is running this file
Not Bun. Node v22.22.0 is running this file

Keep that little file around. It's a better debugging instinct than any version number, because it asks the program who it is instead of guessing from the command you typed.

This is the reader the whole thing is for. If an AI agent set up your project, ran bun, and told you "it works on Node 26," run who.js before you believe it. That 26 may be Bun describing its compatibility, not a Node 26 installed anywhere on your machine. In my run, node -v still said 22.22.0 the whole time.

Why Bun answers with a Node number

Neither answer is a lie, and nothing is broken. Think of it as plumbing. Your tutorial's code was written for Node's pipes, and it asks the runtime "which Node are you?" so it can pick the right fittings. Bun wants that code to keep working, so when asked, it reports a Node version that describes the Node features it imitates. That number belongs to the compatibility, not to the program running.

Sure, but why would anyone design it that way? Because libraries look at that number to decide what to do. A package that says "if Node is older than X, use the slow path" needs a sensible number back. If Bun reported nothing, or reported its own 1.4.2 where a Node version is expected, a perfectly fine library could decide it was running on something ancient and refuse to start.

This has happened, and it is on record. Bun's own issue number 420, titled "Compatibility with node and yarn: process.version", describes how yargs-parser — a popular library for reading command-line options — ran a minimum-Node check, read process.version, got Bun's own version back, and failed. It was closed in November 2022 once Bun started returning a Node-shaped value. The lesson holds: version strings are how code introduces itself, and getting the introduction wrong has consequences.

Why this matters

When something fails in a tutorial, the first useful question is "what ran this?" If you followed instructions written for Node but your command went through Bun, the error you see belongs to a different runtime than the one the author tested. Those two can behave differently in small ways, and you can lose an evening blaming the tutorial, your typing, or yourself.

A runtime mismatch is a quiet failure. Nothing crashes at the moment of confusion; you only find out later, when a result differs from the one in the tutorial. The check above is cheap enough to do before that happens.

The one practical rule: one package manager per project

There's a second place this bites, and it's the one most likely to cost you time. Bun can also install packages (it's a package manager as well as a runtime: the tool that downloads the libraries your project depends on). So can npm, which comes with Node.

Here is what happened when I ran both in the same folder, on the same small package.json listing a single dependency:

bun install
npm install
ls
bun.lock
node_modules
package-lock.json
package.json

Two lockfiles. A lockfile is the record of exactly which version of each library got installed, so the next install reproduces it. Now your project has two competing records, written by two different tools, and nothing tells you which is authoritative. A teammate (or you, next month) installs with the other tool and quietly gets different versions.

The advice here is simple, and it's right: pick one per project and delete the other lockfile. Concretely:

  • If you're following a tutorial that says npm install, use npm, and delete bun.lock if one appeared (rm bun.lock, or drag it to the trash in your file manager).
  • If you chose Bun, use bun install, and delete package-lock.json (rm package-lock.json, or delete it the same way).
  • Whichever you choose, use the same one for every install in that folder.

Notice that this has nothing to do with which runtime is "better." You can run Bun's installer and Node's runtime together without a problem. What you can't do is let two tools both think they own the dependency list.

What I did not check

I ran this on Bun 1.4.2 and Node 22.22.0, and only on one machine. I haven't tested how far Bun's Node compatibility goes in general, and I'd distrust anyone who gives you a flat percentage for it. All I'm claiming is the narrow thing above: the three version lines, what each printed here, and which one is the honest one.

Final thought

Do this tonight, in any folder where you've been following a tutorial. Save who.js from above, run it with bun and with node, and confirm you can predict both answers before you run them. Then run ls and look for two lockfiles. If you find bun.lock and package-lock.json side by side, pick the tool your tutorial uses and delete the other one.

That's the failure this prevents: spending an evening debugging a runtime you didn't know was the one running.

Your Terminal Says Node 22. A Bun Script Says Node 26. Neither Is Lying. | Vibecodes