Bit Version Manager

BVM is a version manager for Bit.
Using BVM makes it easier to install and manage multiple versions of Bit in a single environment.

Features

  • Consistent installation: All Bit dependencies are bundled together to ensure a consistent and predictable package installation that is not affected by SemVer rules.
  • Fast installation: A simple and quick installation process that requires no additional time-consuming operations (post-install scripts, etc.)
  • Friendly UX: Easy upgrades and version management
  • Multiple Bit versions: Easily switch between Bit versions or even use multiple versions in parallel

Install BVM

npm i -g @teambit/bvm
yarn global add @teambit/bvm
CopiedCopy

Install Bit

bvm install
CopiedCopy
bvm upgrade
CopiedCopy

Troubleshooting

Getting errors due to firewall/proxy

Depending on your proxy or firewall settings, use the following configs to have BVM use the correct proxy:

bvm config set proxy http://proxy.example.com:8080
bvm config set https_proxy https://proxy.example.com:8080;
CopiedCopy

BVM is not recognized in your terminal

If you get this error, run:

Windows

setx path "%path%;%AppData%\npm" and re-open your terminal
CopiedCopy
note

Important! Make sure to copy and store your path variable before running the above command, so that you can restore your path if needed (e.g. if it exceeds the maximum path length). If it does exceed the maximum, you will likely be able to reduce its current length by using common path aliases such as `%AppData% used above, which replaces the full path to your user's AppData folder.

MacOS/Linux

# npm
echo 'export PATH=$(npm bin -g):$PATH' >> ~/.zshrc && source ~/.zshrc
# yarn
echo 'export PATH=$(yarn global bin):$PATH'  >> ~/.zshrc && source ~/.zshrc
CopiedCopy
# npm
echo 'export PATH=$(npm bin -g):$PATH' >> ~/.bashrc && source ~/.bashrc
# yarn
echo 'export PATH=$(yarn global bin):$PATH'  >> ~/.bashrc && source ~/.bashrc
CopiedCopy

Global Bit install location was not found

Windows

Please run the following command:

setx path "%path%;%LocalAppData%\.bvm"
CopiedCopy

then re-open the terminal.

MacOS/Linux

Please run the following command:

echo 'export PATH=$HOME/bin:$PATH' >> ~/.zshrc && source ~/.zshrc
CopiedCopy
echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc && source ~/.bashrc
CopiedCopy

then re-open the terminal.

Using v15 and v14

If you have a previous version of Bit installed (bit-bin), the default binary name for v15 will be bbit.

You can change the binary name for Harmony by running the following command after installing BVM and before installing Bit.

bvm config set DEFAULT_LINK <new-value>
CopiedCopy

Manage versions

bvm version
CopiedCopy
bvm list --remote
CopiedCopy
bvm list
CopiedCopy
bvm remove <bit-version>
CopiedCopy

BVM configurations

BVM has several configurations

  • DEFAULT_LINK - The default command name to be linked to BVM's latest version.
    bit is linked by default unless a legacy version of Bit is installed. In that case, bbit will be linked, instead.
  • BVM_DIR - The location for BVM
bvm config
CopiedCopy
bvm config set <property> <new-value>
CopiedCopy