Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
6413e523
Unverified
Commit
6413e523
authored
Apr 15, 2026
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Apr 15, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix monorepo `@next/swc` binary postinstall (#92813)
parent
b6cf70eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
pnpm-workspace.yaml
pnpm-workspace.yaml
+2
-0
install-native.mjs
scripts/install-native.mjs
+29
-6
No files found.
pnpm-workspace.yaml
View file @
6413e523
...
...
@@ -29,6 +29,8 @@ ignoredBuiltDependencies:
-
ssh2
-
unrs-resolver
-
wasm-pack
# Keep security related settings in sync with pnpm-workspace.yaml written to
# temporary fixture dirs in file://./scripts/install-native.mjs
blockExoticSubdeps
:
true
minimumReleaseAge
:
2880
# 48 hrs
minimumReleaseAgeExclude
:
...
...
scripts/install-native.mjs
View file @
6413e523
...
...
@@ -3,6 +3,7 @@ import path from 'path'
import
execa
from
'execa'
import
fs
from
'fs'
import
fsp
from
'fs/promises'
import
{
outdent
}
from
'outdent'
;(
async
function
()
{
if
(
process
.
env
.
NEXT_SKIP_NATIVE_POSTINSTALL
)
{
console
.
log
(
...
...
@@ -58,20 +59,43 @@ import fsp from 'fs/promises'
packageManager
,
}
fs
.
writeFileSync
(
path
.
join
(
tmpdir
,
'package.json'
),
JSON
.
stringify
(
pkgJson
))
fs
.
writeFileSync
(
path
.
join
(
tmpdir
,
'.npmrc'
),
'node-linker=hoisted'
)
fs
.
writeFileSync
(
path
.
join
(
tmpdir
,
'pnpm-workspace.yaml'
),
''
+
outdent
`
nodeLinker: hoisted
`
+
'
\
n'
+
// Propagate security related settings from file://./../../pnpm-workspace.yaml
outdent
`
blockExoticSubdeps: true
minimumReleaseAge: 2880 # 48 hrs
minimumReleaseAgeExclude:
- '@next/*'
- '@turbo/*'
- '@vercel/*'
- '@workflow/*'
- babel-plugin-react-compiler
- next
- react
- react-dom
- react-is
- react-server-dom-*
- scheduler
- turbo
`
)
const
args
=
[
'add'
,
`next@
${
nextVersion
}
`
,
'--lockfile=false'
,
'--ignore-workspace'
,
'--ignore-scripts'
,
]
if
(
preferOffline
)
{
args
.
push
(
'--prefer-offline'
)
}
let
{
stdout
}
=
await
execa
(
'pnpm'
,
args
,
{
cwd
:
tmpdir
})
console
.
log
(
stdout
)
await
execa
(
'pnpm'
,
args
,
{
cwd
:
tmpdir
})
let
pkgs
=
fs
.
readdirSync
(
path
.
join
(
tmpdir
,
'node_modules/@next'
))
fs
.
mkdirSync
(
path
.
join
(
cwd
,
'node_modules/@next'
),
{
recursive
:
true
})
...
...
@@ -91,7 +115,6 @@ import fsp from 'fs/promises'
fs
.
rmSync
(
tmpdir
,
{
recursive
:
true
,
force
:
true
})
console
.
log
(
'Installed the following binary packages:'
,
pkgs
)
}
catch
(
e
)
{
console
.
error
(
e
)
console
.
error
(
'Failed to load @next/swc binary packages'
)
throw
new
Error
(
'Failed to install @next/swc binary packages'
,
{
cause
:
e
})
}
})()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment