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

[v3.0.0] Wrong workspace setup causing a yarn installation warning on user-end #479

Closed
AviVahl opened this issue Jun 2, 2018 · 7 comments · Fixed by #481
Closed

[v3.0.0] Wrong workspace setup causing a yarn installation warning on user-end #479

AviVahl opened this issue Jun 2, 2018 · 7 comments · Fixed by #481

Comments

@AviVahl
Copy link
Contributor

AviVahl commented Jun 2, 2018

Describe the bug

When installing webpack-cli@v3.0.0 using yarn, one sees the following warning:
warning Workspaces can only be enabled in private projects.

The warning only occurs if webpack-cli is being resolved for the first time (meaning it is not yet in the yarn.lock file).

To Reproduce
Steps to reproduce the behavior:

mkdir new-project
cd new-project
yarn init -y
yarn add webpack webpack-cli --dev

See warning.

Expected behavior
No such warning should show. I thought there was an error with my own workspace (which uses webpack-cli).

Additional context
webpack-cli should be just another package inside packages. It should have its own package.json without the "workspaces" field, which causes the warning on user-end.

The root package.json should be "private": true and contain the "workspaces" key. It should not be published.

Using latest yarn@1.7.0.

@evenstensberg
Copy link
Member

Could you do a PR?

@AviVahl
Copy link
Contributor Author

AviVahl commented Jun 2, 2018

Changing the entire project setup and moving stuff around requires better level of familiarity with the current setup/scripts/lifecycle/ci/tooling.

Instead, I made a PR to just remove the "workspaces" key, as it is not really used. It should fix the warning on user end.

@ev1stensberg

@evenstensberg
Copy link
Member

okay great. That's what I was hoping for as well. CLI shouldn't be a private package. Thanks for having a look!

@AviVahl
Copy link
Contributor Author

AviVahl commented Jun 2, 2018

Just to clarify, the broader intention was to move the webpack-cli to a cli folder inside packages, with its own (non-private) package.json.

In a yarn workspace project, the root package.json is just a common, private, one.

This is just not a yarn workspace. Its a lerna bootstraped one.

@evenstensberg
Copy link
Member

CC-ing @sendilkumarn , he knows more about this than me. And yes, if the package remains webpack-cli, I'm in favor.

@iMobs
Copy link

iMobs commented Jun 3, 2018

Alternatively, "npmClient": "yarn" and "useWorkspaces": true could be set in lerna.json and "private": true set in package.json to leverage yarn workspaces hoisting node modules.

@jmckenney
Copy link

Alternatively, "npmClient": "yarn" and "useWorkspaces": true could be set in lerna.json and "private": true set in package.json to leverage yarn workspaces hoisting node modules.

I wish this was stackoverflow and we could vote this to the top.

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

Successfully merging a pull request may close this issue.

4 participants