pnpm: 8.7.0 regression, failed to run deploy command with workspace protocol dependencies

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

8.7.0

Which area(s) of pnpm are affected? (leave empty if unsure)

CLI

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

Run pnpm deploy on foo package with following deps:

{
  "name": "@org/foo",
  "dependencies": {
    "@org/bar": "workspace:*"
  }
}
pnpm i -g pnpm@8.7.0
pnpm --filter=foo --prod deploy .deployment/foo
ERR_PNPM_CANNOT_RESOLVE_WORKSPACE_PROTOCOL  Cannot resolve workspace protocol of dependency "@org/bar" because this dependency is not installed. Try running "pnpm install".

Describe the Bug

Regression in pnpm v8.7.0.

It works well after downgrading to v8.6.12

Expected Behavior

No error as 8.6.12 and before

Which Node.js version are you using?

v18.17.1

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 7
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for the reproduction!

I can confirm this is being impacted by https://github.com/pnpm/pnpm/pull/6943.

The crux of the issue is basically what I described above. Because of the more complicated install (injected dependency) this section of code is being during the install. However it requires the code to already be installed. That is a circular dependency that does not have a good base case.

I’m not sure a new setting is the answer here. I mean it would resolve the issue, but I think the real solution is to move this “make exportable manifest” logic to a different place.

Potentially we could keep the “make exportable manifest” logic in the same place and use some setting/option or simply swallow the error, but that feels like we are addressing symptoms rather than the cause.

For near term, I would suggest reverting the PR to bring back latest version to healthy.

Probably also want a new test effectively mirroring https://github.com/geekytime/pnpm-install-error-example to help avoid this regression in the future

Forking the issue discussed by @jonkoops + @geekytime to https://github.com/pnpm/pnpm/issues/7040

The root issue being discussed here is separate (failure on deploy because install never executed)

The same PR caused the regression, but the impacts are different and possible solutions are different