The message
file:///app/node_modules/rolldown/dist/shared/create-bundler-option-DJpvtSqr.mjs:8
import { formatWithOptions, styleText } from "node:util";
^^^^^^^^^
SyntaxError: The requested module 'node:util' does not provide an export named 'styleText'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
Node.js v18.20.5styleText is a Node function that colours text in the terminal. It only exists from Node 20.12 and 21.7. Vite 8 and its bundler, rolldown, import it as soon as they load: on an older Node, the import fails before the build even starts.
If you see this message, your project is not the problem. The Node version that builds it, on your machine, in your CI or at your host, is too old.
Version by version
The trap is to upgrade just enough to make the message disappear. We built the same project under six Node versions, changing nothing else.
| Node | styleText exists | vite build result |
|---|---|---|
| 18.20.5 | no | fails: export named 'styleText' |
| 20.11.1 | no | fails: export named 'styleText' |
| 20.12.0 | yes | fails: Cannot find native binding |
| 20.18.1 | yes | fails: Cannot find native binding |
| 22.11.0 | yes | fails: Cannot find native binding |
| 22.12.0 | yes | built in 837 ms |
Between Node 20.12 and 22.11, styleText exists and the message goes away. But the build fails right after on another error, “Cannot find native binding”, which blames npm and has nothing to do with it. Vite 8’s real requirement is higher: ^20.19.0 || >=22.12.0. That is the threshold to aim for, not the styleText one.
The same error in MCP Inspector
The MCP Inspector, the tool used to test a Model Context Protocol server, ships its interface with Vite. Started from an older Node, it stops on the same import, worded slightly differently.
Error running MCP Inspector: The requested module 'node:util' does not provide an export named 'styleText'The current Inspector declares "node": ">=22.19.0". On Node 22.19 it starts normally. The fix is the same as for Vite: upgrade Node, not the project.
Do not be fooled if it works on an even older Node. On Node 18.20 (npm 10.8), npx quietly installed Inspector 0.15.0, an old release with no Node requirement, and it started. On Node 20.11 (npm 10.2), it took the latest release and crashed. You get a working tool or an error depending on your npm, not on your project.
The fix
Declare the version in the project itself. Vercel, Netlify and Nixpacks read at least one of these two files, and the declaration travels with the code instead of depending on a setting forgotten in a dashboard.
{
"engines": {
"node": ">=22.12"
}
}22On your machine, nvm install 22 then nvm use 22 install the latest 22. On Vercel, the version can also be set in the project settings, under Build and Deployment; on Netlify, with the NODE_VERSION variable. Either way, package.json remains the safest declaration.
Sources
- [1]Node.js documentation, util.styleText, the function was added in v21.7.0 and v20.12.0.
- [2]The package.json of Vite 8.3.0, engines field: ^20.19.0 || >=22.12.0. Same requirement for rolldown 1.2.9 and its native binaries.
- [3]The package.json of @modelcontextprotocol/inspector 2.11.0, engines field: >=22.19.0.
- [4]Our tests, official Docker images node:18.20.5, 20.11.1, 20.12.0, 20.18.1, 22.11.0 and 22.12.0 on 23 September 2026; MCP Inspector on node:18.20.5, 20.11.1, 22.12.0 and 22.19.0 on 21 October 2026.