npmpackagecontinuous-integrationpnpm

In a monorepo, using manypkg in our CI, and it's failing because of a version mismatch, but it doesn't make sense


I inherited a monorepo, that is deployed and functioning, but the CI has been failing. Here is an excerpt package.json of a frontend app:

{
  "name": "@myorg/clientApp",
  "version": "0.1.0",
  "dependencies": {
    "@myorg/auth": "workspace:*",

So you can see it has a dependency on a private package in the monorepo, auth

Here is the package.json of the auth workspace

{
  "name": "@myorg/auth",
  "version": "0.1.0",

It seems to be setup correctly, and things build locally, and also in production, everything looks great. But CI has been failing forever. so I looked into it and found a manypkg check step that was failing, with errors like this:

error @myorg/clientApp has a dependency on @myorg/auth@workspace:* but the version of @myorg/auth in the repo is 0.1.0 which is not within range of the depended on version, please update the dependency version

I don't understand why this is an error, because the clientApp is declaring a dependency in the workspace, of * any version right? So why is 0.1.0 not within the range?

I am about to try to just ignore this error instead,there is probably 50 of these same errors because there are a handful of internal private packages in the monorepo that are referenced by several apps.

Any ideas here would be greatly appreciated.


Solution

  • Support for workspace:* was added in @manypkg/cli@0.21.3, so make sure your CI runs a more recent version of manypkg.