Skip to content

pnpm build fails on Windows due to POSIX NODE_OPTIONS syntax #277

@sevencat2004

Description

@sevencat2004

Bug report

On Windows, the build script uses POSIX-style environment variable assignment:

"build": "NODE_OPTIONS=\"--max-old-space-size=1024\" next build"

When run from a Windows shell, the command fails before Next.js starts because NODE_OPTIONS is treated as an executable name.

Reproduction

From a fresh checkout on Windows:

npm run build

Observed output:

'NODE_OPTIONS' is not recognized as an internal or external command,
operable program or batch file.

Expected behavior

The build script should start Next.js consistently across Windows and POSIX shells while preserving the 1024 MB old-space limit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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