Prerequisites

  • Ensure you have Node.js and npm (Node Package Manager) installed on your system, as Babel is typically used within a Node.js environment.

Initialize Your Project:

  • If you haven’t already, create a new project directory or navigate to an existing one in your terminal.

Install Babel CLI:

  • Install Babel’s command-line interface (CLI) globally or as a project dependency by running either of the following commands, depending on your preference:
    • Globally: npm install -g @babel/cli
    • Locally (recommended for project-specific use): npm install --save-dev @babel/cli