Skip to content

Commit 92be8f7

Browse files
andrew-polkclaude
andcommitted
fix(ci): unblock npm publish under allow-directory=root
The Publish step has been failing with EALLOWDIRECTORY ("Fetching non-root packages of type directory have been disabled") since the first release after the dependency-safety .npmrc landed. nx-release-publish runs npm publish from each package's dist dir, so the spec is a directory; libnpmpack passes _isRoot to pacote.manifest() but not to the subsequent pacote.tarball() call, so pacote treats our own package as a non-root directory fetch and refuses it. Reproduces on npm 11.16 through 12.0.1. Override allow-directory for the Publish step only, so installs keep the full policy. Nothing in that step resolves dependencies, so the relaxation has no reachable effect beyond letting npm read the dist dir it already resolved; the published tarball is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent aab49a9 commit 92be8f7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ jobs:
6363
- name: Publish
6464
env:
6565
NPM_CONFIG_PROVENANCE: true
66+
# Work around an npm bug: libnpmpack calls pacote.tarball() without
67+
# _isRoot, so publishing a local directory (which is what
68+
# nx-release-publish does, from each package's dist) trips our
69+
# .npmrc allow-directory=root policy with EALLOWDIRECTORY. Still
70+
# broken as of npm 12.0.1. Scoped to this step so installs keep the
71+
# full policy; safe only because nothing resolves dependencies here
72+
# (no npm install, and no package has a prepare/prepack script --
73+
# if one is ever added, revisit this).
74+
NPM_CONFIG_ALLOW_DIRECTORY: all
6675
shell: bash
6776
run: |
6877
set -euo pipefail

0 commit comments

Comments
 (0)