Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Standalone Output doesn't work with PNPM #69858

@Charismara

Description

@Charismara

Link to the code that reproduces this issue

https://github.com/Charismara/nextjs-output-pnpm-issue

To Reproduce

  1. Create a new Project
  2. Install dependencies with pnpm
  3. Add output: "standalone" to your nextjs config file
  4. Build Project with pnpm
  5. --> Run into the following error:
Failed to copy traced files for C:\Users\****\IdeaProjects\pnpm-issue\.next\server\pages\_document.js Error: EPERM: operation not permitted, symlink 'C:\Users\****\IdeaProjects\pnpm-issue\node_modules\.pnpm\[email protected][email protected][email protected][email protected]\node_modules\next' -> 'C:\Users\****\IdeaProjects\pnpm-issue\.next\standalone\node_modules\next'

Current vs. Expected behavior

An error occurs which prevents the project from building.

The Project builds just fine without the output: standalone option set.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32548
  Available CPU cores: 32
Binaries:
  Node: 20.14.0
  npm: N/A
  Yarn: N/A
  pnpm: 9.7.0
Relevant Packages:
  next: 14.2.8 // Latest available version is detected (14.2.8).
  eslint-config-next: 14.2.8
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.4
Next.js Config:
  output: standalone

Which area(s) are affected? (Select all that apply)

Output (export/standalone)

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    OutputRelated to the the output configuration option.bugIssue was opened via the bug report template.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions