Skip to content

verify-deps-before-run fails with "has dependencies but does not have a modules directory" #9424

@jgarplind

Description

@jgarplind

Verify latest release

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

pnpm version

10.8.1

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

No response

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

No response

Reproduction steps

.npmrc

node-linker=hoisted
verify-deps-before-run=error
strict-dep-builds=true

folder structure (mirrored in pnpm-workspace):

app1
  node_modules
app2
  [notably no node_modules]
packages
  util1
    node_modules
  util2
    [notably no node_modules]
node_modules

When executing essentially any command, e.g. pnpm -r test, this error is thrown:

ERR_PNPM_VERIFY_DEPS_BEFORE_RUN  Workspace package app2 has dependencies but does not have a modules directory

By manually adding an empty node_modules folder, I can circumvent it. I then get the same issue for util2, apply the same workaround again, and then we're good to go.

Describe the Bug

verify-deps-before-run seems overeager in its validation, always forcing re-installation, even when dependencies are unchanged. Presumably when combined with node-linker=hoisted?

Expected Behavior

Check should pass unless dependencies are actually outdated.

Which Node.js version are you using?

22.13.0

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)

Ubuntu 24.04.1 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions