nextjs - ✅(Solved) Fix Dev Server NPM error code ENOWORKSPACES with PNPM 10 [2 pull requests, 5 comments, 3 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#86841Fetched 2026-04-08 02:08:58
View on GitHub
Comments
5
Participants
3
Timeline
11
Reactions
2
Author
Timeline (top)
commented ×5cross-referenced ×2issue_type_added ×1labeled ×1

Error Message

next dev Downloading swc package @next/swc-darwin-arm64... to /Users/X/Library/Caches/next-swc npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm. npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm. npm warn Unknown env config "minimum-release-age". This will stop working in the next major version of npm. npm error code ENOWORKSPACES npm error This command does not support workspaces. npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2025-12-04T20_44_00_899Z-debug-0.log Unhandled Rejection: Error: Failed to get registry from "pnpm". at ignore-listed frames { [cause]: Error: Command failed: pnpm config get registry npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm. npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm. npm warn Unknown env config "minimum-release-age". This will stop working in the next major version of npm. npm error code ENOWORKSPACES npm error This command does not support workspaces. npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2025-12-04T20_44_00_899Z-debug-0.log

  at ignore-listed frames {
status: 1,
signal: null,
output: [
  null,
  <Buffer >,
  <Buffer 6e 70 6d 20 77 61 72 6e 20 55 6e 6b 6e 6f 77 6e 20 65 6e 76 20 63 6f 6e 66 69 67 20 22 6e 70 6d 2d 67 6c 6f 62 61 6c 63 6f 6e 66 69 67 22 2e 20 54 68 ... 576 more bytes>
],
pid: 17033,
stdout: <Buffer >,
stderr: <Buffer 6e 70 6d 20 77 61 72 6e 20 55 6e 6b 6e 6f 77 6e 20 65 6e 76 20 63 6f 6e 66 69 67 20 22 6e 70 6d 2d 67 6c 6f 62 61 6c 63 6f 6e 66 69 67 22 2e 20 54 68 ... 576 more bytes>

} }

Fix Action

Fixed

PR fix notes

PR #86845: fix: PNPM Workspace throws ENOWORKSPACES error when fetching registry…

Description (problem / solution / changelog)

What?

Next.js commands like dev and build fail in pnpm workspaces for versions after 10.7.0.

Why?

pnpm now defaults to npm when running config get registry. This fails when ran in a workspace, as the --no-workspaces flag is missing.

How?

If pnpm is found in getRegistry, we should fallback to npm to include the flag, as pnpm is defaulting to npm anyway.

Fixes #86841

Changed files

  • packages/next/src/lib/helpers/get-registry.ts (modified, +13/-4)

PR #90924: fix: pass npm auth token when fetching from the registry

Description (problem / solution / changelog)

Why?

getRegistry() returns the registry URL, but every caller then uses fetch() without auth headers. This causes 401 on any npm registry that requires authentication.

How?

getRegistry() now also reads the auth token from .npmrc and returns { registry, authToken? }. All three callers pass it as a Bearer header when present.

No new files. No new dependencies. Same execSync pattern already used for the URL.

Related

ReferenceTitle
Closes #59081next build not using npm token when downloading SWC
#73479Found lockfile missing swc dependencies (14 👍)
#68522fix: NPM Workspace ENOWORKSPACES (merged, same pattern)
#86841Dev Server ENOWORKSPACES with PNPM 10
#78235Failed to download SWC package
#30468Failed to load SWC feedback megathread

Changed files

  • packages/next/src/cli/next-info.ts (modified, +5/-2)
  • packages/next/src/lib/download-swc.ts (modified, +6/-2)
  • packages/next/src/lib/helpers/get-registry.ts (modified, +31/-2)
  • packages/next/src/lib/patch-incorrect-lockfile.ts (modified, +7/-3)
  • test/unit/get-registry.test.ts (added, +81/-0)

Code Example

> next dev
Downloading swc package @next/swc-darwin-arm64... to /Users/X/Library/Caches/next-swc
npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm.
npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm.
npm warn Unknown env config "minimum-release-age". This will stop working in the next major version of npm.
npm error code ENOWORKSPACES
npm error This command does not support workspaces.
npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2025-12-04T20_44_00_899Z-debug-0.log
Unhandled Rejection: Error: Failed to get registry from "pnpm".
    at ignore-listed frames {
  [cause]: Error: Command failed: pnpm config get registry 
  npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm.
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
  npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm.
  npm warn Unknown env config "minimum-release-age". This will stop working in the next major version of npm.
  npm error code ENOWORKSPACES
  npm error This command does not support workspaces.
  npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2025-12-04T20_44_00_899Z-debug-0.log
  
      at ignore-listed frames {
    status: 1,
    signal: null,
    output: [
      null,
      <Buffer >,
      <Buffer 6e 70 6d 20 77 61 72 6e 20 55 6e 6b 6e 6f 77 6e 20 65 6e 76 20 63 6f 6e 66 69 67 20 22 6e 70 6d 2d 67 6c 6f 62 61 6c 63 6f 6e 66 69 67 22 2e 20 54 68 ... 576 more bytes>
    ],
    pid: 17033,
    stdout: <Buffer >,
    stderr: <Buffer 6e 70 6d 20 77 61 72 6e 20 55 6e 6b 6e 6f 77 6e 20 65 6e 76 20 63 6f 6e 66 69 67 20 22 6e 70 6d 2d 67 6c 6f 62 61 6c 63 6f 6e 66 69 67 22 2e 20 54 68 ... 576 more bytes>
  }
}

---

> next dev

Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/next@16.1.0-canary.12_react-dom@19.2.1_react@19.2.1__react@19.2.1/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
Attempted to load @next/swc-darwin-arm64, but it was not installed
Attempted to load @next/swc-wasm-nodejs, but it was not installed
Attempted to load @next/swc-wasm-web, but it was not installed
Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
Failed to load next.config.ts, see more info here https://nextjs.org/docs/messages/next-config-error
Error: Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
    at ignore-listed frames
Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/next@16.1.0-canary.12_react-dom@19.2.1_react@19.2.1__react@19.2.1/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
Attempted to load @next/swc-darwin-arm64, but it was not installed
Attempted to load @next/swc-wasm-nodejs, but it was not installed
Attempted to load @next/swc-wasm-web, but it was not installed
Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc

ELIFECYCLECommand failed with exit code 1.

---

Running `npx --no-install next info` also crashes, here's the output:


Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/next@16.1.0-canary.12_react-dom@19.2.1_react@19.2.1__react@19.2.1/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
Attempted to load @next/swc-darwin-arm64, but it was not installed
Attempted to load @next/swc-wasm-nodejs, but it was not installed
Attempted to load @next/swc-wasm-web, but it was not installed
Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
Unhandled Rejection: Error: Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
    at ignore-listed frames


As a reference, here's my OS info from another issue I did from this machine:


Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:16:21 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10

---

@my-project:build: npm error code ENOWORKSPACES
@my-project:build: npm error This command does not support workspaces.
@my-project:build: npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-12-04T20_20_15_934Z-debug-0.log
@my-project:build: unhandledRejection [Error: Failed to get registry from "pnpm".] {
@my-project:build:   [cause]: [Error: Command failed: pnpm config get registry 
@my-project:build:   npm error code ENOWORKSPACES
@my-project:build:   npm error This command does not support workspaces.
@my-project:build:   npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-12-04T20_20_15_934Z-debug-0.log
@my-project:build:   ] {
@my-project:build:     status: 1,
@my-project:build:     signal: null,
@my-project:build:     output: [
@my-project:build:       null,
@my-project:build:       <Buffer >,
@my-project:build:       <Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 4e 4f 57 4f 52 4b 53 50 41 43 45 53 0a 6e 70 6d 20 65 72 72 6f 72 20 54 68 69 73 20 63 6f 6d 6d 61 6e ... 141 more bytes>
@my-project:build:     ],
@my-project:build:     pid: 270,
@my-project:build:     stdout: <Buffer >,
@my-project:build:     stderr: <Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 4e 4f 57 4f 52 4b 53 50 41 43 45 53 0a 6e 70 6d 20 65 72 72 6f 72 20 54 68 69 73 20 63 6f 6d 6d 61 6e ... 141 more bytes>
@my-project:build:   }
@my-project:build: }
@my-project:build:ELIFECYCLECommand failed with exit code 1.
@my-project:build: ERROR: command finished with error: command (/vercel/path0/packages/my-project) /vercel/.local/share/pnpm/.tools/pnpm/10.24.0/bin/pnpm run build exited (1)
@my-project#build: command (/vercel/path0/packages/my-project) /vercel/.local/share/pnpm/.tools/pnpm/10.24.0/bin/pnpm run build exited (1)
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/franknoel/next-workspace-swc-issue

To Reproduce

  1. Clone the repo and install the workspace dependencies using pnpm i
  2. Navigate to the Next.js app using cd packages/reproduction-app
  3. Run pnpm dev

Current vs. Expected behavior

The last command should run the dev server normally, but instead it crashes while trying to download SWC.

> next dev
Downloading swc package @next/swc-darwin-arm64... to /Users/X/Library/Caches/next-swc
npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm.
npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm.
npm warn Unknown env config "minimum-release-age". This will stop working in the next major version of npm.
npm error code ENOWORKSPACES
npm error This command does not support workspaces.
npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2025-12-04T20_44_00_899Z-debug-0.log
Unhandled Rejection: Error: Failed to get registry from "pnpm".
    at ignore-listed frames {
  [cause]: Error: Command failed: pnpm config get registry 
  npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm.
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
  npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm.
  npm warn Unknown env config "minimum-release-age". This will stop working in the next major version of npm.
  npm error code ENOWORKSPACES
  npm error This command does not support workspaces.
  npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2025-12-04T20_44_00_899Z-debug-0.log
  
      at ignore-listed frames {
    status: 1,
    signal: null,
    output: [
      null,
      <Buffer >,
      <Buffer 6e 70 6d 20 77 61 72 6e 20 55 6e 6b 6e 6f 77 6e 20 65 6e 76 20 63 6f 6e 66 69 67 20 22 6e 70 6d 2d 67 6c 6f 62 61 6c 63 6f 6e 66 69 67 22 2e 20 54 68 ... 576 more bytes>
    ],
    pid: 17033,
    stdout: <Buffer >,
    stderr: <Buffer 6e 70 6d 20 77 61 72 6e 20 55 6e 6b 6e 6f 77 6e 20 65 6e 76 20 63 6f 6e 66 69 67 20 22 6e 70 6d 2d 67 6c 6f 62 61 6c 63 6f 6e 66 69 67 22 2e 20 54 68 ... 576 more bytes>
  }
}

After running pnpm dev again, it throws the following:

> next dev

⚠ Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
⚠ Attempted to load @next/swc-darwin-arm64, but it was not installed
⚠ Attempted to load @next/swc-wasm-nodejs, but it was not installed
⚠ Attempted to load @next/swc-wasm-web, but it was not installed
⨯ Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
⨯ Failed to load next.config.ts, see more info here https://nextjs.org/docs/messages/next-config-error
Error: Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
    at ignore-listed frames
⚠ Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
⚠ Attempted to load @next/swc-darwin-arm64, but it was not installed
⚠ Attempted to load @next/swc-wasm-nodejs, but it was not installed
⚠ Attempted to load @next/swc-wasm-web, but it was not installed
⨯ Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc

 ELIFECYCLE  Command failed with exit code 1.

Provide environment information

Running `npx --no-install next info` also crashes, here's the output:


Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
⚠ Attempted to load @next/swc-darwin-arm64, but it was not installed
⚠ Attempted to load @next/swc-wasm-nodejs, but it was not installed
⚠ Attempted to load @next/swc-wasm-web, but it was not installed
⨯ Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
Unhandled Rejection: Error: Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
    at ignore-listed frames


As a reference, here's my OS info from another issue I did from this machine:


Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:16:21 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10

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

SWC

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

next dev (local), next build (local), Vercel (Deployed)

Additional context

I initially discovered this issue while trying to do the security update for CVE-2025-66478. It was somehow working fine before updating to v15.5.7 on my other project.

It is also crashing during Vercel deployment during the build step. Here's the error output:

@my-project:build: npm error code ENOWORKSPACES
@my-project:build: npm error This command does not support workspaces.
@my-project:build: npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-12-04T20_20_15_934Z-debug-0.log
@my-project:build: unhandledRejection [Error: Failed to get registry from "pnpm".] {
@my-project:build:   [cause]: [Error: Command failed: pnpm config get registry 
@my-project:build:   npm error code ENOWORKSPACES
@my-project:build:   npm error This command does not support workspaces.
@my-project:build:   npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-12-04T20_20_15_934Z-debug-0.log
@my-project:build:   ] {
@my-project:build:     status: 1,
@my-project:build:     signal: null,
@my-project:build:     output: [
@my-project:build:       null,
@my-project:build:       <Buffer >,
@my-project:build:       <Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 4e 4f 57 4f 52 4b 53 50 41 43 45 53 0a 6e 70 6d 20 65 72 72 6f 72 20 54 68 69 73 20 63 6f 6d 6d 61 6e ... 141 more bytes>
@my-project:build:     ],
@my-project:build:     pid: 270,
@my-project:build:     stdout: <Buffer >,
@my-project:build:     stderr: <Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 4e 4f 57 4f 52 4b 53 50 41 43 45 53 0a 6e 70 6d 20 65 72 72 6f 72 20 54 68 69 73 20 63 6f 6d 6d 61 6e ... 141 more bytes>
@my-project:build:   }
@my-project:build: }
@my-project:build:  ELIFECYCLE  Command failed with exit code 1.
@my-project:build: ERROR: command finished with error: command (/vercel/path0/packages/my-project) /vercel/.local/share/pnpm/.tools/pnpm/10.24.0/bin/pnpm run build exited (1)
@my-project#build: command (/vercel/path0/packages/my-project) /vercel/.local/share/pnpm/.tools/pnpm/10.24.0/bin/pnpm run build exited (1)

extent analysis

TL;DR

The issue is likely due to a compatibility problem between pnpm and next when using workspaces, causing the next dev command to fail while trying to download SWC.

Guidance

  • Check the pnpm version and consider upgrading to a version that supports workspaces.
  • Verify that the next configuration is correct and that the swc binary is installed correctly.
  • Try running pnpm install instead of pnpm dev to ensure that all dependencies are installed correctly.
  • Consider using a different package manager, such as npm or yarn, to see if the issue is specific to pnpm.

Example

No code snippet is provided as the issue seems to be related to the package manager and workspace configuration.

Notes

The issue seems to be related to the ENOWORKSPACES error, which indicates that the pnpm command does not support workspaces. This error is not specific to next or swc, but rather a general issue with pnpm and workspace configuration.

Recommendation

Apply a workaround by using a different package manager, such as npm or yarn, to install and run the project. This may help to bypass the issue with pnpm and workspaces.

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