Skip to content

pnpm fetch creates node_modules folder  #8623

@ofer-shaham

Description

@ofer-shaham

Verify latest release

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

pnpm version

v9.12.1

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

Operating System (Windows, MacOS, Linux)

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

No response

Reproduction steps

rm -rf node_modules

pnpm fetch --prod

ls -l node_modules
du -h node_modules

Describe the Bug

pnpm fetch command creates node_modules folder in the current directory.
fetch should populate the store without effecting the current directory.

Expected Behavior

pnpm fetch should be use for populating the npm store based on store-dir configuration without changing the project directory.

then pnpm install --offline should create the project's node_modules directory.

Which Node.js version are you using?

v22.9

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)

redhat

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions