nextjs - 💡(How to fix) Fix "Error parsing package.json file" when using `file:` dependency (symlinked files) [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#87647Fetched 2026-04-08 02:06:43
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
commented ×2issue_type_added ×1labeled ×1mentioned ×1

Error Message

Error parsing package.json file

Code Example

./next/node_modules/lib/package.json
Error parsing package.json file
package.json is not parseable: invalid JSON: a redirect can't be parsed as json

---

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Education
  Available memory (MB): 16237
  Available CPU cores: 12
Binaries:
  Node: 24.11.0
  npm: 11.6.1
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.1.0 // Latest available version is detected (16.1.0).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

---

## Error Type
Build Error

## Error Message
Error parsing package.json file

## Build Output
./next/node_modules/lib/package.json
Error parsing package.json file
package.json is not parseable: invalid JSON: a redirect can't be parsed as json

Next.js version: 16.1.0 (Turbopack)
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/rubenferreira97/turbopack_issue

To Reproduce

  1. Start application in dev mode
  2. Go to initial page (http://localhost:3000)
  3. Check error:
⨯ ./next/node_modules/lib/package.json
Error parsing package.json file
package.json is not parseable: invalid JSON: a redirect can't be parsed as json

Current vs. Expected behavior

  • Expected: Turbopack resolves symlinked files correctly and imports libNumber from lib.
  • Actual: Turbopack reports Error parsing package.json file.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Education
  Available memory (MB): 16237
  Available CPU cores: 12
Binaries:
  Node: 24.11.0
  npm: 11.6.1
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.1.0 // Latest available version is detected (16.1.0).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Turbopack

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

next dev (local), next build (local), next start (local)

Additional context

## Error Type
Build Error

## Error Message
Error parsing package.json file

## Build Output
./next/node_modules/lib/package.json
Error parsing package.json file
package.json is not parseable: invalid JSON: a redirect can't be parsed as json

Next.js version: 16.1.0 (Turbopack)

extent analysis

TL;DR

The issue is likely due to an invalid package.json file in the lib directory, which is causing Turbopack to fail, and a potential workaround is to verify and correct the package.json file.

Guidance

  • Check the package.json file in the lib directory for any syntax errors or invalid JSON, and correct them if necessary.
  • Verify that the package.json file is not a redirect, as Turbopack is unable to parse redirects as JSON.
  • Try removing any unnecessary dependencies or scripts in the package.json file that may be causing the issue.
  • If the issue persists, try updating the next package to the latest version, although the current version (16.1.0) is already the latest available.

Example

No code snippet is provided as the issue is related to a configuration file error.

Notes

The issue seems to be specific to the Turbopack configuration and the package.json file in the lib directory. The provided environment information and Next.js configuration do not seem to be directly related to the issue.

Recommendation

Apply workaround: Verify and correct the package.json file in the lib directory, as it is the most likely cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix "Error parsing package.json file" when using `file:` dependency (symlinked files) [2 comments, 2 participants]