-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Description
When using Yarn v4 with nodeLinker: pnpm
, Turborepo is unable to find the locally installed turbo
package and falls back to using the globally installed version, which can cause unexpected behavior.
Reproduction Steps
- Clone this repository https://github.com/ZeekoZhu/yarn-pnpm-turbo
- Run
yarn install
to install dependencies - Run
yarn turbo-version
Expected Behavior
The command should use the locally installed turbo version (^2.5.6) without any warnings.
Actual Behavior
WARNING No locally installed `turbo` found in your repository. Using globally installed version (2.5.6), which can cause unexpected behavior.
Installing the version in your repository (^2.5.6) before calling `turbo` will result in more predictable behavior across environments.
2.5.6
Configuration
- Yarn version: 4.9.4
- Turbo version: ^2.5.6
- nodeLinker: pnpm
- Package manager: yarn@4.9.4
Files
package.json
: Contains turbo dependency and script.yarnrc.yml
: Configured withnodeLinker: pnpm
Root Cause
The per-platform packages as linked in (realpath node_modules/turbo)/../node_modules
, but the code here searches the wrong location for yarn (pnpm linker).
turborepo/crates/turborepo-lib/src/shim/local_turbo_state.rs
Lines 46 to 49 in 6d0af4b
// - berry (nodeLinker: "pnpm") | |
fn generate_nested_path(root_path: &AbsoluteSystemPath) -> Option<AbsoluteSystemPathBuf> { | |
Some(root_path.join_components(&["node_modules", "turbo", "node_modules"])) | |
} |
radhi-nasser-scaleway, yevheniizh, ryansuhartanto, sidwood, jlew25 and 1 more
Metadata
Metadata
Assignees
Labels
No labels