diff --git a/docs/repo-docs/getting-started/add-to-existing-repository.mdx b/docs/repo-docs/getting-started/add-to-existing-repository.mdx index a561e9c5c9879..725e60452fd28 100644 --- a/docs/repo-docs/getting-started/add-to-existing-repository.mdx +++ b/docs/repo-docs/getting-started/add-to-existing-repository.mdx @@ -179,13 +179,27 @@ Add `.turbo` to your `.gitignore` file. The `turbo` CLI uses these folders for p -### Run the `build` and `check-types` tasks with `turbo` +### Add a `packageManager` field to root `package.json` + +Turborepo optimizes your repository using information from your package manager. To declare which package manager you're using, add a [`packageManager`](https://nodejs.org/api/packages.html#packagemanager) field to your root `package.json` if you don't have one already. + +```diff title="package.json" +{ ++ "packageManager": "npm@8.5.0" +} +``` + + + +### Run tasks with `turbo` + +You can now run the tasks you added to `turbo.json` earlier using Turborepo. Using the example tasks from above: ```bash title="Terminal" turbo build check-types ``` -This runs `build` and `check-types` at the same time. +This runs the `build` and `check-types` tasks at the same time, respecting the dependency graph of your project.