Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.
Docs menu / Installation

Installation

Requirements:

  • TypeScript 5.4 or newer.
  • Node.js 22.18 or newer, Deno, and Bun are supported.

Manual Installation

JavaScript runtimes

Follow these steps to create a new Effect project for Node.js, Bun, or Deno:

  1. Create a project directory and navigate into it:

    Terminal window
    mkdir hello-effect
    cd hello-effect
  2. Initialize a TypeScript project:

    Terminal window
    npm init -y
    npm install --save-dev typescript
    Terminal window
    pnpm init
    pnpm add --save-dev typescript
    Terminal window
    yarn init -y
    yarn add --dev typescript
    Terminal window
    bun init
    Terminal window
    deno init

    This creates a package.json file with an initial setup for your TypeScript project. For Bun, this also generates a tsconfig.json file. For Deno, this generates a deno.json file.

    Make sure the package.json file contains the "type": "module" field, so that Node.js treats your source files as ES modules (bun init adds this automatically):

    {
    "type": "module"
    }
  3. Initialize TypeScript:

    Terminal window
    npx tsc --init
    Terminal window
    pnpm tsc --init
    Terminal window
    yarn tsc --init

    bun init has already generated a tsconfig.json file.

    Deno runs TypeScript out of the box, and deno init has already generated a deno.json file with strict mode enabled by default. No further configuration is needed.

    When running this command, it will generate a tsconfig.json file that contains configuration options for TypeScript. One of the most important options to consider is the strict flag.

    Make sure to open the tsconfig.json file and verify that the value of the strict option is set to true.

    {
    "compilerOptions": {
    "strict": true
    }
    }
  4. Install the necessary package as dependency:

    Terminal window
    npm install effect
    Terminal window
    pnpm add effect
    Terminal window
    yarn add effect
    Terminal window
    bun add effect
    Terminal window
    deno add npm:effect

    This package will provide the foundational functionality for your Effect project.

Let’s write and run a simple program to ensure that everything is set up correctly.

In your terminal, execute the following commands:

Terminal window
mkdir src
touch src/index.ts

Open the src/index.ts file and add the following code:

src/index.ts
import { Effect, Console } from "effect"
const program = Console.log("Hello, World!")
Effect.runSync(program)

Run the src/index.ts file. Node.js 22.18 or newer, Bun, and Deno can run TypeScript files directly, so no additional tooling is needed: