esno
raw JSON → 4.8.0 verified Mon Apr 27 auth: no javascript
A Node.js runtime enhanced with esbuild for loading TypeScript and ESM modules. Version 4.8.0 is current and stable, with frequent releases alongside tsx. esno is essentially an alias of tsx (formerly esno was separate, now merged into tsx package). Differentiator: auto CJS/ESM mode detection, seamless TypeScript execution without config, and caching for faster reloads. Suitable for scripts, CLIs, and development servers.
Common errors
error ERR_MODULE_NOT_FOUND: Cannot find module 'esno' imported from ↓
cause Using esno as a programmatic import but it's a CLI-only package.
fix
Use 'tsx' package: import 'tsx' or use npx tsx.
error TypeError: esno is not a function ↓
cause Importing esno as a function, but the default export is a no-op.
fix
Use tsx for programmatic usage: import 'tsx'.
error Error: Cannot find module 'esno/register' ↓
cause The register path was removed; esno delegates to tsx.
fix
Use node -r tsx/register script.ts instead.
error Warning: esno is deprecated; use tsx instead. ↓
cause esno is now an alias of tsx.
fix
Switch to tsx: npm uninstall -g esno && npm install -g tsx
Warnings
breaking From v0.15, esno is an alias of tsx; all issues must be reported in esbuild-kit/tsx. ↓
fix Use tsx package instead for new projects or if you need programmatic API.
deprecated The 'esno' package itself is deprecated in favor of 'tsx'. ↓
fix Migrate to 'tsx' for future updates and support.
gotcha esno does not provide a programmatic API; importing it is a no-op. ↓
fix Use 'tsx' package for transform or register hooks in code.
gotcha If using require('esno'), it will not register the TypeScript loader; use -r esno/register. ↓
fix Use node -r esno/register script.ts instead of programmatic require.
Install
npm install esno yarn add esno pnpm add esno Imports
- default wrong
const esno = require('esno')correctimport esno from 'esno' - tsx wrong
import 'esno'correctimport 'tsx' - require('esno') wrong
require('esno')correctnode -r esno/register script.ts
Quickstart
npx esno hello.ts