Skip to content

fix: exempt explicit tarball targets from allow-file - #10145

Open
lazerg wants to merge 1 commit into
npm:latestfrom
lazerg:fix/10144-allow-file-explicit-tarball
Open

lazerg wants to merge 1 commit into
npm:latestfrom
lazerg:fix/10144-allow-file-explicit-tarball

Conversation

@lazerg

@lazerg lazerg commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

npm publish ./pkg.tgz and npm pack ./pkg.tgz fail with EALLOWFILE when allow-file is none or root. The tarball named on the command line is the package being packed or published, not a dependency, but the dependency fetch policy was still applied to it when reading its manifest and tarball.

This does for file specs what #9756 did for directory specs: pack, publish and libnpmpack set allowFile: 'all' when the target itself is a local tarball. Dependency fetches are unchanged.

Testing

Added allow-file=none|root cases for a tarball target to the pack, publish and libnpmpack tests. They fail with EALLOWFILE before the change and pass after. The full suite passes locally.

References

Fixes #10144

@lazerg
lazerg requested a review from a team as a code owner October 20, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] allow-file=none|root breaks npm publish

1 participant