[GH-ISSUE #11] Getting Error [ERR_REQUIRE_ESM]: require() of ES Module executing on MacOS with PNPM #9

Closed
opened 2026-02-27 19:20:53 +03:00 by kerem · 0 comments
Owner

Originally created by @selfagency on GitHub (Nov 13, 2025).
Original GitHub issue: https://github.com/f/git-rewrite-commits/issues/11

/Users/daniel/Library/pnpm/global/5/.pnpm/git-rewrite-commits@0.3.2/node_modules/git-rewrite-commits/dist/cli.js:41
const chalk_1 = __importDefault(require("chalk"));
                                ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/daniel/Library/pnpm/global/5/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js from /Users/daniel/Library/pnpm/global/5/.pnpm/git-rewrite-commits@0.3.2/node_modules/git-rewrite-commits/dist/cli.js not supported.
Instead change the require of index.js in /Users/daniel/Library/pnpm/global/5/.pnpm/git-rewrite-commits@0.3.2/node_modules/git-rewrite-commits/dist/cli.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/daniel/Library/pnpm/global/5/.pnpm/git-rewrite-commits@0.3.2/node_modules/git-rewrite-commits/dist/cli.js:41:33) {
  code: 'ERR_REQUIRE_ESM'
}
Originally created by @selfagency on GitHub (Nov 13, 2025). Original GitHub issue: https://github.com/f/git-rewrite-commits/issues/11 ``` /Users/daniel/Library/pnpm/global/5/.pnpm/git-rewrite-commits@0.3.2/node_modules/git-rewrite-commits/dist/cli.js:41 const chalk_1 = __importDefault(require("chalk")); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/daniel/Library/pnpm/global/5/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js from /Users/daniel/Library/pnpm/global/5/.pnpm/git-rewrite-commits@0.3.2/node_modules/git-rewrite-commits/dist/cli.js not supported. Instead change the require of index.js in /Users/daniel/Library/pnpm/global/5/.pnpm/git-rewrite-commits@0.3.2/node_modules/git-rewrite-commits/dist/cli.js to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/Users/daniel/Library/pnpm/global/5/.pnpm/git-rewrite-commits@0.3.2/node_modules/git-rewrite-commits/dist/cli.js:41:33) { code: 'ERR_REQUIRE_ESM' } ```
kerem closed this issue 2026-02-27 19:20:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-rewrite-commits#9
No description provided.