Skip to content

docs: cleanup fixes for package managers #10512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ The root `package.json` is the base for your workspace. Below is a common exampl
"devDependencies": {
"turbo": "latest"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"workspaces": ["apps/*", "packages/*"]
}
```

Expand All @@ -297,7 +298,8 @@ The root `package.json` is the base for your workspace. Below is a common exampl
"devDependencies": {
"turbo": "latest"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"workspaces": ["apps/*", "packages/*"]
}
```

Expand All @@ -316,7 +318,8 @@ The root `package.json` is the base for your workspace. Below is a common exampl
"devDependencies": {
"turbo": "latest"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"workspaces": ["apps/*", "packages/*"]
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ familiar with Turborepo.

We recommend you install `turbo` both globally and into your repository's root for the best developer experience.

<Tabs items={['npm', 'yarn', 'pnpm']} storageKey="selected-pkg-manager">
<Tab value="npm">
<PackageManagerTabs>
<Tab value="pnpm">
Ensure you have created a `pnpm-workspace.yaml` file before you begin the installation. Failure to have this file will result in an error that says: ` --workspace-root may only be used inside a workspace`.

```bash title="Terminal"
# Global install
npm install turbo --global
pnpm add turbo --global
# Install in repository
npm install turbo --save-dev
pnpm add turbo --save-dev --workspace-root
```

</Tab>
Expand All @@ -64,18 +65,27 @@ We recommend you install `turbo` both globally and into your repository's root f
```

</Tab>
<Tab value="pnpm">
Ensure you have created a `pnpm-workspace.yaml` file before you begin the installation. Failure to have this file will result in an error that says: ` --workspace-root may only be used inside a workspace`.
<Tab value="npm">

```bash title="Terminal"
# Global install
pnpm add turbo --global
npm install turbo --global
# Install in repository
pnpm add turbo --save-dev --workspace-root
npm install turbo --save-dev
```

</Tab>
</Tabs>
<Tab value="bun (Beta)">

```bash title="Terminal"
# Global install
bun install turbo --global
# Install in repository
bun install turbo --dev
```

</Tab>
</PackageManagerTabs>

To learn more about why we recommend both installations, visit the [Installation page](/docs/getting-started/installation).

Expand Down Expand Up @@ -185,12 +195,50 @@ Add `.turbo` to your `.gitignore` file. The `turbo` CLI uses these folders for p

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.

<PackageManagerTabs>

<Tab value="pnpm">

```diff title="package.json"
{
+ "packageManager": "[email protected]"
}
```

</Tab>

<Tab value="yarn">

```diff title="package.json"
{
+ "packageManager": "[email protected]"
}
```

</Tab>

<Tab value="npm">

```diff title="package.json"
{
+ "packageManager": "[email protected]"
}
```

</Tab>

<Tab value="bun (Beta)">

```diff title="package.json"
{
+ "packageManager": "[email protected]"
}
```

</Tab>

</PackageManagerTabs>

<Callout type="good-to-know">
Depending on your repository, you may need to use the
[`dangerouslyDisablePackageManagerCheck`](/docs/reference/configuration#dangerouslydisablepackagemanagercheck)
Expand Down
Loading