diff --git a/.yarn/versions/dafa68fb.yml b/.yarn/versions/dafa68fb.yml new file mode 100644 index 000000000000..3e27c141ce1b --- /dev/null +++ b/.yarn/versions/dafa68fb.yml @@ -0,0 +1,23 @@ +releases: + "@yarnpkg/cli": patch + "@yarnpkg/plugin-pnpm": patch + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-essentials" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-nm" + - "@yarnpkg/plugin-npm-cli" + - "@yarnpkg/plugin-pack" + - "@yarnpkg/plugin-patch" + - "@yarnpkg/plugin-pnp" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - "@yarnpkg/builder" + - "@yarnpkg/core" + - "@yarnpkg/doctor" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b54b55bb351..19b34b2a2f54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ Yarn now accepts sponsorships! Please give a look at our [OpenCollective](https: ## Master +### Installs +- The pnpm linker no longer tries to remove `node_modules` directory, when `node-modules` linker is active + **Note:** features in `master` can be tried out by running `yarn set version from sources` in your project (existing contrib plugins are updated automatically, while new contrib plugins can be added by running `yarn plugin import from sources `). ## 3.2.0 diff --git a/packages/plugin-pnpm/sources/PnpmLinker.ts b/packages/plugin-pnpm/sources/PnpmLinker.ts index 96914f1b4091..8f28458eb9cc 100644 --- a/packages/plugin-pnpm/sources/PnpmLinker.ts +++ b/packages/plugin-pnpm/sources/PnpmLinker.ts @@ -274,10 +274,11 @@ class PnpmInstaller implements Installer { } // Wait for the package installs to catch up - await this.asyncActions.wait(), + await this.asyncActions.wait(); await removeIfEmpty(storeLocation); - await removeIfEmpty(getNodeModulesLocation(this.opts.project)); + if (this.opts.project.configuration.get(`nodeLinker`) !== `node-modules`) + await removeIfEmpty(getNodeModulesLocation(this.opts.project)); return { customData: this.customData,