System Requirements
Before installing Effect, ensure your environment meets these requirements:- Node.js: Version 18 or newer
- TypeScript: Version 5.4 or newer
- Package Manager: npm, pnpm, yarn, or bun
Effect takes full advantage of TypeScript’s type system and requires strict type checking to be enabled.
Installing Effect
Install theeffect package using your preferred package manager:
effect package includes:
- Core Effect runtime and data types
- Context and Layer for dependency injection
- Fiber-based concurrency primitives
- Stream for reactive programming
- Schema for validation and parsing
- And much more
TypeScript Configuration
Effect requires strict type-checking to ensure type safety. Update yourtsconfig.json to include these settings:
tsconfig.json
Configuration Explained
strict: true
strict: true
Enables all strict type-checking options. This is required for Effect to work correctly. It includes:
strictNullChecks: Ensuresnullandundefinedare handled explicitlystrictFunctionTypes: Enforces stricter function type checkingnoImplicitAny: Prevents implicitanytypes- And other strict checks
moduleResolution: bundler
moduleResolution: bundler
Recommended for modern TypeScript projects. Alternatively, you can use
"node16" or "nodenext".target and lib
target and lib
Effect uses modern JavaScript features like generators. Setting
target to ES2022 or newer ensures these features are available.skipLibCheck: true
skipLibCheck: true
Speeds up compilation by skipping type checking of declaration files. Recommended for most projects.
Editor Setup
For the best development experience, configure your editor with TypeScript support.Visual Studio Code
VS Code has excellent TypeScript support out of the box. Recommended extensions:-
TypeScript and JavaScript Language Features (built-in)
- Provides IntelliSense, refactoring, and error checking
-
Error Lens (optional)
- Shows TypeScript errors inline
- Install:
usernamehw.errorlens
-
Pretty TypeScript Errors (optional)
- Makes TypeScript errors more readable
- Install:
yoavbls.pretty-ts-errors
Other Editors
- WebStorm: Full TypeScript support built-in
- Neovim: Use
typescript-language-serverwithnvim-lspconfig - Emacs: Use
tideorlsp-modewithtypescript-language-server - Sublime Text: Use
LSP-typescript
Verifying Installation
Create a test file to verify your installation:Optional Tools
These tools enhance your Effect development experience:Development Runtime
tsx and ts-node let you run TypeScript files directly without compilation.
Effect DevTools
The Effect DevTools provide runtime inspection and debugging:Testing
For testing Effect programs, use the official testing utilities:Troubleshooting
Type errors about generators
Type errors about generators
Ensure your
tsconfig.json has "target": "ES2022" or newer. Generators require ES2015+ target.Module resolution errors
Module resolution errors
Try setting
"moduleResolution": "bundler" or "node16" in your tsconfig.json.Errors about 'strict mode required'
Errors about 'strict mode required'
Effect requires
"strict": true in tsconfig.json. This is not optional.Import errors in Node.js
Import errors in Node.js
If using Node.js with ES modules, ensure your
package.json has "type": "module" or use .mts file extensions.Next Steps
Now that Effect is installed and configured, you’re ready to build your first application:Quickstart
Build your first Effect program in 5 minutes
Core Concepts
Learn the core concepts of Effect