question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug?]: yarn workspaces focus <pkg> command fails in ^3.0.0-rc

See original GitHub issue

Self-service

  • I’d be willing to implement a fix

Describe the bug

When running the command yarn workspaces focus <pkg> in 3.0-rc versions

Type Error: e.every is not a function
    at test (/frontend/.yarn/releases/yarn-3.0.0-rc.9.cjs:10:36984)

To reproduce


const path = require(`path`);
const {promises: {mkdir, readFile, writeFile, writeJson}} = require(`fs`);

await packageJsonAndInstall({
  "name": "root",
  "private": true,
  "workspaces": [
    "packages/*"
  ]
});


/* create an app module*/

await mkdir('packages/lib', { recursive: true });

await writeFile("packages/lib/package.json", `{
  "peerDependencies": {
    "lodash": "^4.0.0"
  },
  "main": "index.js",
  "name": "lib",
  "version": "0.0.1"
}`);

const version = await yarn('--version');
console.log('version', version);

await yarn(`install`);

await expect(yarn(`workspaces`, `focus`, `lib`)).rejects.not.toThrow();

Environment

System: OS: macOS 11.4 CPU: (4) x64 Intel® Core™ i5-7500 CPU @ 3.40GHz Binaries: Node: 14.2.0 Yarn: 3.0.0-rc.9

Additional context

It seems to be throwing from the typanion package

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
merceyzcommented, Jul 9, 2021

You need to update the plugins you’re using as well when you update the CLI

3reactions
davidcalhouncommented, Aug 3, 2021

The specific fix for this:

yarn plugin import @yarnpkg/plugin-workspace-tools

Highly recommend running the same for all your plugins listed in your .yarnrc.yml

Read more comments on GitHub >

github_iconTop Results From Across the Web

`yarn workspaces focus` | Yarn - Package Manager
Details. This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones...
Read more >
Advanced package manager features for npm, Yarn, and pnpm
While the focus in the previous article was on comparing core concepts and structures, this article will cover the advanced features of modern ......
Read more >
CHANGELOG.md · @yarnpkg/plugin-git/2.4.0-rc.5 ... - GitCode
The yarn workspaces focus command will now only run the postinstall scripts for the focused workspaces. A new yarn npm audit command lets...
Read more >
21 Practical YARN Command Examples to Manage Projects ...
In this article, I will take you through 21 Practical YARN command examples to manage projects in Linux. Yarn is an independent cross ......
Read more >
A guide through The Wild Wild West of setting up a mono repo ...
We will be using TypeScript, Yarn workspaces, Lerna, and Jest. The release of the ... The lerna run command will run in every...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found