Installation
Get started with Turborepo in a few moments using:
The starter repository will have:
- Two deployable applications
- Three shared libraries for use in the rest of the monorepo
For more details on the starter, visit the README for the basic starter on GitHub. You can also use an example that more closely fits your tooling interests.
Installing turbo
turbo can be installed both globally and in your repository. We highly recommend installing both ways so you can take advantage of fast, convenient workflows and a stable version of turbo for all developers working in your repository.
Global installation
A global install of turbo brings flexibility and speed to your local workflows.
Once installed globally, you can run your scripts through turbo from your terminal, quickly running one-off commands to use within your repository. For example:
turbo build: Runbuildscripts following your repository's dependency graphturbo build --filter=docs --dry: Quickly print an outline of thebuildtask for yourdocspackage (without running it)turbo generate: Run Generators to add new code to your repositorycd apps/docs && turbo build: Run thebuildscript in thedocspackage and its dependencies. For more, visit the Automatic Package Scoping section.
Good to know:
turbo is an alias for turbo run. For example,
turbo build and turbo run build will both run your build task.
Avoid multiple global installations
If you've installed global turbo before, make sure you use the same package
manager as your existing installation to avoid unexpected behaviors. You can
quickly check which package manager you previously used with turbo bin.
Using global turbo in CI
You can also take advantage of global turbo when creating your CI pipelines. Visit the Constructing CI guide for more information.
Repository installation
When collaborating with other developers in a repository, it's a good idea to pin versions of dependencies. You can do this with turbo by adding it as a devDependency in the root of your repository:
You can continue to use your global installation of turbo to run commands. Global turbo will defer to the local version of your repository if it exists.
This lets you to get the best of both installations: easily run commands in your terminal while maintaining a pinned version for consistent usage for all developers in the repository.