nx icon indicating copy to clipboard operation
nx copied to clipboard

fix(core): ensure yarn runs install with correct version

Open meeroslav opened this issue 2 years ago • 2 comments

Current Behavior

Installation of packages using ensurePackage and create-nx-workspace fail for Yarn Berry because they create temp folder that might be targeting different yarn version

Let's assume this folder structure:

$HOME 
  - my-berry-projects // subfolder with 
      .yarnrc.yaml // berry version set
      - my-project
        package.json // <- this is our project
  .yarnrc.yaml // classic version set

If we run yarn install in the my-project folder we would be using yarn berry. But our CNW and ensurePackage generate a temp folder outside of the $HOME, so running yarn would end up in using yarn classic which then causes issues.

Expected Behavior

Before running yarn install or yarn add in the temp folder we need to run yarn set version classic/berry according to the local version of our project to make sure two versions are in-sync.

Related Issue(s)

Fixes #

meeroslav avatar Jul 06 '23 14:07 meeroslav

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 7, 2023 8:03am

vercel[bot] avatar Jul 06 '23 14:07 vercel[bot]

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8b0f6ef0b4430ad26cb86ed53bd2b29415029b0c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Jul 06 '23 14:07 nx-cloud[bot]

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

github-actions[bot] avatar Jul 13 '23 00:07 github-actions[bot]