Hey, I tried implementing Workspaces on a repo and here is some feedback that you might be interested in.
Basically I am having trouble running yarn outdated, yarn upgrade-interactive or other similar commands in a workspaces project.
What is the current behavior?
yarn outdated or yarn upgrade-interactive run from the root folder work only for the root package.json.
If I run those commands in a packages/* folder the error No lockfile in this directory. Run 'yarn install' to generate one. comes up.
What is the expected behavior?
yarn outdated or yarn upgrade-interactive should also check workspaces folders when run from root folder.
Please mention your node.js, yarn and operating system version.
yarn v1.0.2 with workspaces flag enabled
node v8.5.0
This is related to #4442
It's the same thing if using the workspace command.
$ yarn workspace @podium/client outdated
yarn workspace v1.0.2
yarn outdated v1.0.2
error No lockfile in this directory. Run `yarn install` to generate one.
error Command failed.
Exit code: 1
Command: /Users/simbekkh/.nvm/versions/node/v8.4.0/bin/node
Arguments: /usr/local/Cellar/yarn/1.0.2/libexec/lib/cli.js outdated
Directory: /Users/simbekkh/repos/podium/packages/podium-client
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
Also, https://yarnpkg.com/en/docs/cli/workspace 404s
This should work the other way round too, i.e., when running it from the root folder of the workspace, it should detect and show possible upgrades for all packages inside that workspace.
I created a similar issue for $ yarn list: https://github.com/yarnpkg/yarn/issues/4494. I guess they are duplicates? I'll close my issue.
Hi! I think the fixes in #4654 might have solved this. Could you give yarn 1.2.0 a go and see if it still reproduces? :-)
Seems to work great!
@edmorley Confirmed #4654 (v1.2.0) fixes this!
Tested it, it now works fine
With "workspaces": [ "*" ] in project root package.json, the yarn list and yarn workspaces run list still fail both in root and nested packages with:
yarn list v1.21.1
error No lockfile in this directory. Run `yarn install` to generate one.
info Visit https://yarnpkg.com/en/docs/cli/list for documentation about this command.
Most helpful comment
This should work the other way round too, i.e., when running it from the root folder of the workspace, it should detect and show possible upgrades for all packages inside that workspace.