Skip to content
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

[1.22.0] yarn worksapces run only recognizes scripts now #7918

Open
travikk opened this issue Feb 20, 2020 · 7 comments
Open

[1.22.0] yarn worksapces run only recognizes scripts now #7918

travikk opened this issue Feb 20, 2020 · 7 comments

Comments

@travikk
Copy link

travikk commented Feb 20, 2020

Bug description

yarn workspaces run seems to only allow run commands which are defined in each package of the workspace. Previously (1.21.1) I was able to execute yarn native commands on each package too.

yarn workspaces run version --new-version 1.1.1

What is the current behavior?

error Command "version" not found.

What is the expected behavior?
Version in each package of the workspace is set to 1.1.1

Steps to Reproduce

  1. Run the command above
  2. Observe the terminal output

Environment

  • Node Version: 12.14.1
  • Yarn v1 Version: 1.22.0
  • OS and version: linux
@bucuri
Copy link

bucuri commented Feb 20, 2020

I have the same behaviour. For my part it's the

yarn workspaces run install

that does not work anymore. The reason seems to be because "install" in a default/hidden target. Only explicitly defined scripts seem to work.

The reason I need this command is because we are using a preinstall hook in each of the workspaces. These hooks were called only if the "install" target was called by "workspaces run".

Yarn version: 1.22.0
Node version: v13.8.0
OS: MacOS Catalina

@heeboA
Copy link

heeboA commented Mar 2, 2020

Any updates on this? Is this intentional or is it a bug?

@taylormadesoft
Copy link

having same issue with "yarn workspaces run install" to get it to run install.sh bash scripts for each workspace sub-folder.
yarn workspaces v1.22.4

@aws-ee/api-handler-factory
yarn run v1.22.4
error Command "install" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /Users/tms2019/.nvm/versions/node/v10.15.3/bin/node
Arguments: /Users/tms2019/.yvm/versions/v1.22.4/lib/cli.js run install
Directory: /Users/tms2019/projects/freddie/solution/packages/api-handler-factory
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspaces for documentation about this command.
Command failed: /Users/tms2019/.yvm/versions/v1.22.4/bin/yarn.js workspaces run install

@PilotConway
Copy link

I recently updated yarn and I'm running into this issue as well.

Would love some kind of update on if this is a bug or intentional, and if it's intentional is there another way to version all our packages in the repo without building a custom script?

@taylormadesoft
Copy link

taylormadesoft commented Aug 18, 2020 via email

@travikk
Copy link
Author

travikk commented Sep 23, 2020

For anyone still having issues with this, in each workspace's package.json I added the following:

"package:set-version": "yarn version"

Then, in the project root you can run yarn workspaces run package:set-version passing any arguments you like and they will be correctly propagated as well.
Works for me.

@dwheeler
Copy link

dwheeler commented Apr 2, 2021

Replying to add another to the list of those affected.
Adding "yarninstall": "yarn install", to package.json in every workspace is a workaround, but really feels like a hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants