Skip to content

[BUG] npm pack <git-dependency>#<commit-hash> fails in npm >= 9.6.5 #6723

@chmeliik

Description

@chmeliik

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

npm pack with a specific commit of a git dependency fails as follows:

$ npm pack vercel/ms#1304f150b38027e0818cc122106b5c7322d68d0c                                   
npm ERR! GitFetcher requires an Arborist constructor to pack a tarball

npm ERR! A complete log of this run can be found in: /home/acmiel/.npm/_logs/2023-08-21T08_27_53_861Z-debug-0.log

Expected Behavior

Expected npm pack to succeed (like it does in version <= 9.6.4).

Note that it still works for things that are not commit hashes:

$ npm pack vercel/ms#3.0.0-canary.1
...
ms-3.0.0-canary.1.tgz

Steps To Reproduce

  1. With npm version 9.6.5 or higher
  2. Run npm pack vercel/ms#1304f150b38027e0818cc122106b5c7322d68d0c or any other git dependency + commit hash
  3. And get npm ERR! GitFetcher requires an Arborist constructor to pack a tarball

Environment

  • npm: 9.8.1
  • Node.js: 18.17.1
  • OS Name: Fedora 37
  • System Model Name: Lenovo ThinkPad X1 Carbon
  • npm config:
; node bin location = /usr/bin/node-18
; node version = v18.17.1
; npm local prefix = /tmp/test
; npm version = 9.8.1
; cwd = /tmp/test
; HOME = /home/acmiel
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 2secondary priority issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions