fever install
Automatically detect and run the appropriate package manager install command based on your project's lock files. This command simplifies dependency management, especially when working across multiple projects that use different package managers.
Usage
fever install [options]
Options
| Option | Description |
|---|---|
--pm <manager> | Force a specific package manager (npm, yarn, pnpm, bun). |
--silent | Run the installation silently, suppressing detection info and package manager output. |
--ci, --frozen-lockfile | Use clean install mode for reproducible installations (e.g., npm ci, pnpm install --frozen-lockfile). |
How It Works
- Lock File Detection: The command checks for lock files in the current directory in the following priority order:
bun.lockb(Bun)pnpm-lock.yaml(pnpm)yarn.lock(Yarn)package-lock.json(npm)
- Package Manager Verification: Once a lock file is detected, it verifies that the corresponding package manager is installed and available in your system's PATH.
- Installation: It then executes the appropriate install command (e.g.,
bun install,pnpm install,yarn install,npm install). - Fallback: If no lock file is found but a
package.jsonexists, it defaults tonpm install.
Clean Install Mode (--ci or --frozen-lockfile)
This mode is ideal for CI/CD pipelines or when you need reproducible builds. It ensures that your node_modules directory exactly matches your lock file, preventing accidental updates.
- npm: Uses
npm ci(removesnode_modules, faster, requires lock file). - pnpm: Uses
pnpm install --frozen-lockfile. - Yarn v1: Uses
yarn install --frozen-lockfile. - Yarn v2+ (Berry): Uses
yarn install --immutable. - Bun: Uses
bun install --frozen-lockfile.
Examples
Auto-Detect and Install
fever install
# Example output if yarn.lock is found:
📦 Package Manager Detection
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Manager: yarn
Lock file: yarn.lock
Command: yarn install
Detection: Detected from lock file
⏳ Running yarn install...
# ... yarn output ...
✅ Dependencies installed successfully!
Force a Specific Package Manager
fever install --pm pnpm
Using specified package manager: pnpm
⏳ Running pnpm install...
# ... pnpm output ...
✅ Dependencies installed successfully!
Clean Install for CI/CD
fever install --ci
# Example output if package-lock.json is found:
📦 Package Manager Detection
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Manager: npm
Lock file: package-lock.json
Command: npm ci (clean install)
Detection: Detected from lock file
⏳ Running npm ci (clean install)...
# ... npm ci output ...
✅ Dependencies installed successfully!
Silent Installation
fever install --silent
Troubleshooting
Could not detect package manager
This usually means there's no package.json or lock file in your current directory.
- Ensure you are running the command from the root of your Node.js project.
- If you're starting a new project, you might need to run
npm init -yfirst.
Package manager not installed
If fever install detects a lock file (e.g., pnpm-lock.yaml) but the corresponding package manager (pnpm) is not installed on your system, it will warn you and try to fall back to another detected package manager (usually npm).
To fix this, install the missing package manager globally:
npm install -g pnpm # or yarn, or bun