Skip to content

Issue: pnpm unpack-next fails on Windows due to POSIX-quoted tar paths #87833

@naveenkarmegam

Description

@naveenkarmegam

Link to the code that reproduces this issue

https://github.com/naveenkarmegam/next.js/blob/canary/scripts/unpack-next.ts#L29

To Reproduce

To reproduce this issue must use windows os

Summary

Running pnpm unpack-next fails on Windows because Next.js dev tooling builds tar commands using POSIX single-quoted paths ('path').
Windows’ built-in tar.exe treats single quotes as literal characters, causing tarballs to not be found and the command to fail.

Steps

  1. git clone https://github.com/vercel/next.js
  2. cd next.js
  3. pnpm install
  4. pnpm pack-next --no-js-build --tar
  5. pnpm unpack-next apps/bundle-analyzer

Current vs. Expected behavior

Current Behavior

The command fails on Windows with an error similar to:
tar: Error opening archive: Failed to open 'D:\...\tarballs\next.tar'

Windows tar.exe treats the single-quoted path as a literal filename, so the tarball cannot be found and unpacking fails.

Image

Expected Behavior

Tarballs should unpack successfully and inject the locally built Next.js packages into the target app without errors.

Provide environment information

Operating System:
  Platform: windows
  Arch: x64
  Version: Windows 11 Pro
Binaries:
  Node: 20.18.2
  pnpm: 9.6.0

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

Testing

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

next package testing

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TestingRelated to testing with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions