The problem in here seems to be an existing
yarn.lock file inside of one of the workspaces. Deleting it solves the problem.
Example: 3 workspaces: 2 create-react-app (
home) and one shared component: (
component folder a lingering
yarn.lock file exists. Remove it.
Also check that:
- All your workspaces have
"private": truein each of their
package.json(same level as
- Check that you have added your workspaces inside a
"workspaces"key in the main
- When you’re executing
yarn workspaces myworkspace
myworkspacematches the name of your workspace in its
package.json. In my case, the name of the workspace inside the
componentsfolder is called
@schon/components, so I need to address it as
yarn worksapces @schon/componentsinstead.
CLICK HERE to find out more related problems solutions.