netlify / netlify/cli

netlify-cli crashes with bunx on Node.js v24: chalk v5/v4 ESM/CJS conflict

Open
#7,997 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.9k
Forks
474
Avg merge
23h 30m
Merged PRs (30d)
53

Description

Summary

bunx netlify-cli@latest crashes on Node.js v24 with TypeError: chalk.blue is not a function due to a dependency resolution conflict between chalk v5 (ESM-only, direct dep) and chalk v4 (CJS, needed by transitive deps).

Root cause

netlify-cli depends on:

  • chalk@5.6.2 directly (ESM-only)
  • inquirer@8.2.7ora@5.4.1log-symbols@4.1.0chalk@^4.1.0 (CJS)

Bun's flat dependency resolution hoists chalk@5 globally, so log-symbols@4 gets chalk v5 instead of chalk v4. Since chalk v5 is ESM-only and log-symbols uses require('chalk'), the default export resolves incorrectly under Node.js v24's stricter CJS/ESM interop — chalk.blue is undefined.

Error trace

TypeError: chalk.blue is not a function
    at Object.<anonymous> (/tmp/bunx-924-netlify-cli@latest/node_modules/log-symbols/index.js:6:14)
    ...
Node.js v24.13.0
error: postinstall script from "netlify-cli" exited with 1

Environment

  • bunx netlify-cli@latest (v24.0.1)
  • Node.js v24.13.0
  • Bun 1.3.9

Suggested fix

Update inquirer to a version that doesn't transitively depend on chalk v4 (e.g. @inquirer/prompts which uses chalk v5 natively), or pin log-symbols to v5+ which dropped the chalk dependency.

Workaround

Use pnpm --package=netlify-cli dlx netlify instead of bunx netlify-cli, as pnpm correctly isolates conflicting dependency versions.

🤖 Filed on behalf of @schickling

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing bunx netlify-cli@latest on Node.js v24 with Bun 1.3.9, then inspect how inquirer, ora, log-symbols and chalk are resolved in the package dependencies. Compare the suggested dependency changes and verify that bunx completes without the chalk.blue error; the workaround and pnpm behavior provide a comparison point.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, node.js, typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.