Yarn – Command yarn import error: This package doesn’t seem to be present in your lockfile; try to make an install to update your resolutions

The problem in here seems to be an existing yarn.lock file inside of one of the workspaces. Deleting it solves the problem.

More info:

Example: 3 workspaces: 2 create-react-app (app, home) and one shared component: (components)

folder strcuture

Inside the component folder a lingering yarn.lock file exists. Remove it.

enter image description here

Also check that:

  1. All your workspaces have "private": true in each of their package.json (same level as name, private, source).
  2. Check that you have added your workspaces inside a "workspaces" key in the main package.json
  3. When you’re executing yarn workspaces myworkspace myworkspace matches the name of your workspace in its package.json. In my case, the name of the workspace inside the components folder is called @schon/components, so I need to address it as yarn worksapces @schon/components instead.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top