Skip to content

Conversation

@Kakadus
Copy link

@Kakadus Kakadus commented Jan 31, 2026

This implements the gitSubdir parameter, which is already parsed by npa, finally allowing users of npm to specifiy subdirectories in git dependencies.

The respective parsing logic has already been agreed on and implemented nearly 4 years ago here: npm/npm-package-arg#91. In this PR, the git fetcher is changed to resolve the gitSubdir parameter from the spec if found, as suggested by the author in the original npa PR.

References

Fixes npm/cli#528
Fixes npm/npm#2974
Relates to npm/npm-package-arg#46
Relates to npm/npm-package-arg#91

Inspired from and crediting sspiff@8bd5461, which seems to have been lost after merging the PR at npa.

@Kakadus Kakadus requested a review from a team as a code owner January 31, 2026 23:06
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.

[FEATURE] Allow adding Git branch dependencies in a subdirectory Allow subdirectories within git repos in npm install

1 participant