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

Publish with Yarn Berry #5197

Closed
mkatanec opened this issue Apr 1, 2021 · 5 comments
Closed

Publish with Yarn Berry #5197

mkatanec opened this issue Apr 1, 2021 · 5 comments
Labels

Comments

@mkatanec
Copy link

mkatanec commented Apr 1, 2021

Current Behavior

After building libraries with Nx I wanted to publish it with Yarn Berry.

To do that I've moved into built library eg cd dist/libs/lib1 and ran yarn npm publish.

Command failed with error: The nearest package directory (dist/libs/lib1) doesn't seem to be part of the project declared in {project_root_folder}

Expected Behavior

Library should be published

Steps to Reproduce

  1. Create Nx monorepo
  2. Generate React libs
  3. Build with affected:build
  4. run yarn npm publish inside a built library

Environment

Nx: v 11.2.12

@vsavkin vsavkin added type: question / discussion scope: react Issues related to React support for Nx and removed type: bug labels Apr 4, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@AndyClausen
Copy link
Contributor

This relates to this issue:
yarnpkg/berry#705

Workaround that I'm using:

  1. Change workspaces folder in package.json from:
  "workspaces": [
    "libs/*"
  ],

to:

  "workspaces": [
    "dist/libs/*"
  ],
  1. Run yarn
  2. Go to the dist/libs folder and run your publish command
  3. Revert 1. and run yarn again

It ain't pretty, but it gets the job done.

@AndyClausen
Copy link
Contributor

This is still a problem, FYI. Could it be reopened?

@hiddenist
Copy link

Also running into this issue.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants