[DOCS] `npm pack` doesn't include file specified in `main` field
Nobody has claimed this yet.
- 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 is a CLI Docs Problem, not another kind of Docs Problem.
- This is a CLI Docs Problem.
Description of Problem
The following section of the docs suggest that even with an empty files array, the path from main in package.json would still be included when running npm pack, but it doesn't behave accordingly for me:
https://github.com/npm/cli/blob/6ca609e20b68fb2e5ef8177db116b84a339461fd/docs/lib/content/configuring-npm/package-json.md?plain=1#L296-L302
Potential Solution
If someone can confirm that this is indeed a discrepancy between the docs and the implementation, one should be adjusted to match the other.
Affected URL
No response
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
Read the linked docs/lib/content/configuring-npm/package-json.md section and reproduce the behavior with npm pack, an empty files array, and the main field in package.json. Compare the documented expectation with the generated package contents; done means the documentation or implementation is aligned with the confirmed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 48/100