Installing dependencies

Run the following to install all dependnecies required for your Bit workspace:

$bit
Copiedcopy
See command synopsis

After installation is complete, package and component dependnecies required by your workspace are resolved and you can start development.

Install components

To install a Bit component, run:

$bit
Copiedcopy
See command synopsis

Components can be imported for local testing or changes and ejected back to be an external dependency. Learn more in Importing components.

Install packages

To add a new external dependency run the following:

$bit
Copiedcopy
See command synopsis

The version installed defaults to the latest. To install a specific version, specify the version to install:

$bit
Copiedcopy
See command synopsis

Workspace configuration

New dependencies isntalled are added to workspace configuration, and installed in the workspace node_modules directory. Components that have this dependency will resolve to this version (unless specified otherwise).

// workspace.jsonc
{
  "teambit.dependencies/dependency-resolver": {
    "policy": {
      "dependencies": {
        "lodash": "1.0.0"
      }
    }
  }
}
CopiedCopy

Dependencies and versions listed in your workspace.jsonc will apply on all components in your workspace. To override specific compoennt dependenceies

Learn more