babel-node-ts
raw JSON → 1.0.3 verified Fri May 01 auth: no javascript deprecated
A lightweight CLI wrapper that runs babel-node with --extensions ts,tsx by default, eliminating the need to manually specify TypeScript file extensions. Version 1.0.3 is the latest stable release. This package is no longer actively maintained and is considered deprecated in favor of modern alternatives like ts-node or tsx. It has a single peer dependency on @babel/node ^7.2.2. Key differentiator: simple extension auto-adding with no configuration.
Common errors
error Error: Cannot find module '@babel/node' ↓
cause Missing peer dependency @babel/node
fix
npm install --save-dev @babel/node
error babel-node-ts: command not found ↓
cause Package not installed globally or not using npx
fix
Use npx babel-node-ts or install globally: npm install -g babel-node-ts
Warnings
deprecated Package is no longer maintained; consider using ts-node or tsx instead. ↓
fix Replace with ts-node: npx ts-node index.ts or tsx: npx tsx index.ts
gotcha Requires @babel/node as a peer dependency; must be installed separately. ↓
fix Install peer dep: npm install --save-dev @babel/node
gotcha Only adds --extensions ts,tsx; does not support other extensions like .tsbuildinfo. ↓
fix Use different tool if custom extensions needed.
Install
npm install babel-node-ts yarn add babel-node-ts pnpm add babel-node-ts Imports
- babel-node-ts wrong
require('babel-node-ts')correctnpx babel-node-ts script.ts - babel-node-ts (CLI) wrong
import babel-node-ts from 'babel-node-ts'correctyarn babel-node-ts script.ts
Quickstart
npx babel-node-ts index.ts