LinuxCommandLibrary

bun-install

Install project dependencies

TLDR

Install all dependencies

$ bun install
copy
Add a dependency
$ bun add [package]
copy
Add a dev dependency
$ bun add -d [package]
copy
Add with exact version
$ bun add --exact [package]
copy
Remove a dependency
$ bun remove [package]
copy
Install without running lifecycle scripts
$ bun install --ignore-scripts
copy
Install for production only
$ bun install --production
copy

SYNOPSIS

bun install [options]
bun add [options] package ...
bun remove package ...

DESCRIPTION

bun install is Bun's built-in package manager, a fast alternative to npm, yarn, and pnpm. It installs dependencies from package.json into a node_modules folder compatible with Node.js.
The package manager uses a global cache to avoid re-downloading packages and employs the fastest system calls available for writing files.

PARAMETERS

-d, --dev

Add as development dependency
--exact
Pin package to exact version
--production
Install only production dependencies
--ignore-scripts
Skip running lifecycle scripts
--frozen-lockfile
Error if lockfile needs update
--force
Force re-download of all packages
--global
Install package globally

LOCKFILE

Bun uses bun.lock (text-based) as the default lockfile since v1.2. Remove other lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml) before first install to avoid conflicts.

TRUSTED DEPENDENCIES

Bun does not run dependency lifecycle scripts by default for security. Allow-list trusted packages using trustedDependencies in package.json.

CAVEATS

Compatible with existing package.json files. Supports workspaces, git/http/tarball dependencies, and custom registries. Some npm-specific features may behave differently.

SEE ALSO

bun(1), bun-add(1), bun-remove(1), npm(1), yarn(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community