Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Yarn: Workspaces can only be enabled in private projects #26

Closed
jackw opened this issue Aug 18, 2021 · 5 comments
Closed

Yarn: Workspaces can only be enabled in private projects #26

jackw opened this issue Aug 18, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jackw
Copy link

jackw commented Aug 18, 2021

Hello, I've tried to bump @wojtekmaj/enzyme-adapter-react-17 to 0.6.3 and doing so results in yarn complaining about "Workspaces can only be enabled in private projects".

I'm guessing it's caused by this project root package.json being used by the NPM module as opposed to the module living in a workspace and the root being a private module and managing all workspaces in the repository. There's a report about it here in yarn repository.

@wojtekmaj
Copy link
Owner

wojtekmaj commented Aug 18, 2021

Yarn 1.x?

Are you able to work around this issue by setting your project to private?

@jackw
Copy link
Author

jackw commented Aug 18, 2021

Yep. We're still running Yarn 1.x and the project is already set to private and has its own workspaces. I was unaware that Yarn 2 / 3 removed this limitation. Maybe it's not worth the effort to support Yarn 1 but wanted to let you know in case you get other reports.

@wojtekmaj wojtekmaj added the bug Something isn't working label Oct 10, 2021
@wojtekmaj
Copy link
Owner

wojtekmaj commented Oct 10, 2021

Hmmmm, unsure how we could easily fix this. Maybe there's some deployment script that would filter out some properties from package.json?

@wojtekmaj wojtekmaj added the help wanted Extra attention is needed label Oct 10, 2021
@drewlustro
Copy link

You can do this with jq

cat package.json | jq "to_entries | map(select(.key | test(\"workspaces\") | not)) | from_entries | ." > package.without-workspaces.json

@wojtekmaj wojtekmaj removed the help wanted Extra attention is needed label Oct 21, 2021
@wojtekmaj
Copy link
Owner

wojtekmaj commented Oct 21, 2021

I did a thing, but hit yarnpkg/berry#3609 when trying to automate it.

Released a version that does not include workspaces in package.json manually as v0.6.5. Please check it out.

Automation will be done in #32.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants