Installation Guide
System Requirements
Before installing Presetter, ensure you have:
- Node.js 20.0.0 or higher
- Active Node.js LTS is recommended; v9 CI tracks active LTS lines and latest.
- npm 7.0.0 or higher (npm 7+ required for automatic peer dependency installation)
- Git (for version control integration)
Package Manager Support
Presetter works seamlessly with all major JavaScript package managers:
npm (Recommended)
npm install --save-dev presetter @presetter/preset-esm
pnpm
pnpm add -D presetter @presetter/preset-esm
yarn
yarn add --dev presetter @presetter/preset-esm
Installation Methods
Method 1: Quick Setup (Recommended)
The fastest way to get started with a new project:
# Create new project directory
mkdir my-awesome-project
cd my-awesome-project
# Initialize package.json
npm init -y
# Install Presetter with a preset
npm install --save-dev presetter @presetter/preset-esm
# Create configuration file
echo "export { default } from '@presetter/preset-esm';" > presetter.config.ts
# Add bootstrap script
npm pkg set scripts.bootstrap="presetter bootstrap"
# Install and bootstrap
npm install
Method 2: Manual Setup
For more control over the installation process:
-
Install packages:
npm install --save-dev presetter @presetter/preset-esm -
Create configuration file:
// presetter.config.tsexport { default } from '@presetter/preset-esm'; -
Update package.json:
{"scripts": {"bootstrap": "presetter bootstrap"}} -
Bootstrap the project:
npm run bootstrap
Preset Selection
Choose the right preset for your project type:
For Modern ES Modules
npm install --save-dev presetter @presetter/preset-esm
Best for: Libraries, Node.js applications, modern web projects
For React Applications
npm install --save-dev presetter @presetter/preset-react
Includes: React-specific linting, Storybook, testing utilities
For Dual CJS/ESM Libraries
npm install --save-dev presetter @presetter/preset-hybrid
Best for: NPM packages that need to support both module systems
For Monorepos (v8+)
npm install --save-dev presetter @presetter/preset-monorepo
Best for: Multi-package repositories with shared configurations, TypeScript project references, unified testing
For Legacy CommonJS
npm install --save-dev presetter @presetter/preset-cjs
Best for: Existing CommonJS projects, legacy Node.js applications
Verification
After installation, verify everything is working:
# Check Presetter CLI is available
npx presetter --help
# Verify configuration files were generated
ls -la tsconfig.json eslint.config.ts vitest.config.ts
# Run a test command
npm run test
Troubleshooting Installation
Common Issues
Node.js version too old:
# Check your Node.js version
node --version
# Upgrade if needed
nvm install --lts # or use your preferred Node version manager
Permission errors:
# Use npx instead of global installation
npx presetter bootstrap
Peer dependency warnings: These are expected! With npm 7+, peer dependencies are automatically installed. Since v8.0.0, Presetter leverages npm's built-in peer dependency handling for a smoother experience.
TypeScript errors in config files: Ensure you have TypeScript installed:
npm install --save-dev typescript
Getting Help
- 📚 Check Advanced Topics for frequently asked questions
- 🐛 Report issues on GitHub
- 💬 Ask questions in GitHub Discussions
What's New in v9
Presetter v9 is a major release that modernizes the toolchain and reorganizes the preset ecosystem:
📦 Scoped package namespace (breaking)
- Every preset now ships under the
@presetter/*scope (for example,@presetter/preset-esm). The mainpresetterCLI package keeps its unscoped name.
🧰 TypeScript 6 + ES2024 (breaking)
- TypeScript 6 is now the required peer dependency.
- The default compile target is ES2024.
noUncheckedIndexedAccessis enabled in the essentials preset for safer indexed access. Thetsconfigtemplates were simplified to rely on TypeScript 6 defaults.- Repository typechecking now uses
tsgovia@typescript/native-preview; published presets continue to use the TypeScript 6 peer baseline.
🆕 New presets
@presetter/preset-node— defaults for Node.js applications.@presetter/preset-bun— defaults for Bun projects.@presetter/preset-storybook— standalone Storybook configuration.
✨ New features
presetter bootstrap --projectsnow accepts package names, not just globs.- lint-staged pre-commit and pre-push hooks out of the box.
- git-cliff powered changelog generation.
- Monorepo sub-level Vitest configuration support.
- Package info is shown during bootstrap.
- Release publishing now uses provenance, and CI follows active Node LTS lines plus latest.
Follow the v8 to v9 Migration Guide for the namespace rename, TypeScript 6 upgrade, and script renames.
Read the v9 release post for the full announcement.
Next Steps
Once installation is complete:
- Understand the concepts: Read Core Concepts
- Learn configuration: See Configuration Guide
- Start coding: Your development environment is ready!
- Explore presets: Browse the Preset Ecosystem
- Migrating from v7?: Check out the v7 to v8 Migration Guide