Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warnings appears always when using pnpm in a workspace with more than one subpackage #8320

Open
2 of 4 tasks
median-dxz opened this issue Jul 19, 2024 · 5 comments
Open
2 of 4 tasks

Comments

@median-dxz
Copy link

median-dxz commented Jul 19, 2024

Verify latest release

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

pnpm version

v9.5.0, v9.6.0, v9.7.0, v9.9.0

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

Lockfile

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

No response

Reproduction steps

Just create a monorepo with the structure below:

  • /
  • package.json
  • pnpm-workspace.yaml
  • pkg1/
    • package.json
  • pkg2/
    • package.json

Use the following pnpm-workspace.yaml file under the root folder:

packages:
  - "pkg1"
  - "pkg2"

Install some dependencies to create the lockfile, then whether using pnpm add or pnpm up, the warnings will appear.

Describe the Bug

WARN  `node_modules` is present. Lockfile only installation will make it out-of-date

Expected Behavior

Can this warning be ignored? If not, what should I do? If yes, why does the warning appear? Is this an intentional design behavior?

Which Node.js version are you using?

v20.11.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

@xenobytezero
Copy link

I'm also getting this issue

PNPM - 9.5.0
Node - 22.5.1
Windows

It does seem like just an erroneous message, node_modules is updated, the package.json is updated and the pnpm-lock.yaml is updated.

Had a brief look at the code, and in installInContext, when dealing with workspace projects, it does seem to recursively run installInContext again with lockfileOnly forced to true. That appears to be the thing triggering the warning.

const result = await installInContext(newProjects, ctx, {
...opts,
lockfileOnly: true,
})

@BabakScript
Copy link

I can confirm the same issue on MacOs. I always have this warning. 🤔

@zoubingwu
Copy link

me too, with [email protected], kinda confused.

@manelio
Copy link

manelio commented Sep 15, 2024

Same here. Although it is not a problem, it is very annoying.

@CharleeWa
Copy link

Same issue. It appears to be a health warning, but triggering hook scripts every time a new dependency is installed makes for a very poor experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants