Skip to content

Error: spawn E2BIG on large package.json files #8552

@d13

Description

@d13

Verify latest release

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

pnpm version

No response

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

https://github.com/gitkraken/vscode-gitlens/tree/e5cd2a2c4630d05ee41c0d6018c880d3f0142b80

💡 You'll notice the package.json is 18086 lines (VS Code extension life)

Reproduction steps

From a Mac terminal or the terminal in VS Code:

  • run pnpm install
  • run pnpm run build or pnpm run lint

Describe the Bug

Running pnpm run build produces the following error:

> gitlens@15.5.0 build /Users/keithdaulton/code/gitkraken/vscode-gitlens.worktrees/debt/pnpm
> webpack --mode development

node:internal/child_process:421
    throw new ErrnoException(err, 'spawn');
    ^

Error: spawn E2BIG
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:762:9)
    at spawn (/Users/keithdaulton/.cache/node/corepack/v1/pnpm/9.10.0/dist/pnpm.cjs:83937:19)
    at runCmd_ (/Users/keithdaulton/.cache/node/corepack/v1/pnpm/9.10.0/dist/pnpm.cjs:103213:20)
    at runCmd (/Users/keithdaulton/.cache/node/corepack/v1/pnpm/9.10.0/dist/pnpm.cjs:103153:9)
    at runPackageLifecycle (/Users/keithdaulton/.cache/node/corepack/v1/pnpm/9.10.0/dist/pnpm.cjs:103120:7)
    at Array.<anonymous> (/Users/keithdaulton/.cache/node/corepack/v1/pnpm/9.10.0/dist/pnpm.cjs:102337:13)
    at LOOP (/Users/keithdaulton/.cache/node/corepack/v1/pnpm/9.10.0/dist/pnpm.cjs:102364:18)
    at chain (/Users/keithdaulton/.cache/node/corepack/v1/pnpm/9.10.0/dist/pnpm.cjs:102371:9)
    at lifecycle_ (/Users/keithdaulton/.cache/node/corepack/v1/pnpm/9.10.0/dist/pnpm.cjs:103094:7) {
  errno: -7,
  code: 'E2BIG',
  syscall: 'spawn'
}

Node.js v20.17.0

Expected Behavior

The package scripts should run normally like when I use yarn as I have in the past or when I use npm now as a workaround.

When I prefix the commands with NODE_DEBUG=child_process, I notice that envPairs when using pnpm has over 10,000 entries. Whereas with npm there's only 50ish entries in envPairs.

Which Node.js version are you using?

v20.17.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)

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy