[BUG] npm pack fails for scoped package from private registry when it's not in the cache
Open
Nobody has claimed this yet.
Bug
config:private-registry
Needs Triage
Release 8.x
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
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
Since version 7.x if the scoped package is not present in the cache the command "npm pack @foo/bar@baz" returns a 404 error.
Refer to this issue : #2918
Expected Behavior
The command "npm pack @foo/bar@baz" work again with scoped package like npm 6.14.
Steps To Reproduce
- Create package with scope like "@foo/bar" in version 1.0.0
- On a server that has never installed this package, try using the command "npm pack @foo/bar@1.0.0"
- A 404 error occurs.
- However, if you do "npm i @foo/bar@1.0.0" it works without error.
- Try using the "npm pack @foo/bar@1.0.0" command again
- it will work without error.
- now try to use "npm cache clean --force"
- Try using the "npm pack @foo/bar@1.0.0" command again
- A 404 error occurs.
Environment
- npm: 8.5.5
- Node.js: 17.8.0
- OS Name: ubuntu (20.04) macos (latest) windows (latest)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the scoped-package case with npm pack against a private registry, then compare it with npm install and the behavior after npm cache clean --force. Trace the npm CLI entry points for pack, install, and cache handling to identify where the uncached package path diverges. Done means npm pack @foo/bar@1.0.0 succeeds on a clean cache without the 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100