Core installation mechanism, Node.js module resolution, CommonJS/ESM compatibility.
Raw Developer Origin & Technical Request
GitHub Issue
Aug 21, 2026
## Summary
The Linux installation fails to start when a parent `package.json` declares `"type": "module"`.
## Environment
- terminal-code/tode: `v0.2.0` (`stable`)
- OS: Linux
- Node.js: `v24.x`
- Installation: official installer (`curl -fsSL tode.sh/install | bash`)
## Reproduction
1. Have a parent package manifest such as `$HOME/package.json` containing:
```json
{ "type": "module" }
```
2. Install terminal-code with the official installer.
3. Run `tode`.
Observed error:
```text
ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '$HOME/package.json' contains "type": "module".
file://$HOME/.local/lib/tode/dist/main.js:6
Object.defineProperty(exports, "__esModule", { value: true });
^
```
## Root cause
The generated `dist/main.js` is CommonJS output and uses `exports`/`require`. However, the release staging script copies `dist/`, `assets/`, and `config/` into the install root without copying a `package.json` that defines the module type. Node/Electron therefore walks up to the user's parent `package.json` and treats the installed `.js` files as native ESM.
Relevant source:
- [`package.json` declares `dist/main.js` as the bin entrypoint](github.com/zenbu-labs/termin...
- [`scripts/dist.sh` stages the install without a package manifest](github.com/zenbu-labs/termin...
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from zenbu-labs/terminal-code.
Frequently Asked Questions
Market intelligence mapped to Core installation mechanism, Node.js module resolution, CommonJS/ESM compatibility..
How is Core installation mechanism, Node.js module resolution, CommonJS/ESM compatibility. positioned in the market?
What architecture is tied to Core installation mechanism, Node.js module resolution, CommonJS/ESM compatibility.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like CommonJS package boundary and type: module by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics