[BUG] `npm publish` ignores symbolic links
Open
Nobody has claimed this yet.
Bug
Needs Triage
Release 9.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
I have a monorepo with several packages. One of the packages is the main package. I have symlinked its README.md file to the file in the root repository.
README.md -> ../../README.md
LICENSE.MIT
cli.js
index.js
package.json
However, when I tried to publish the package, npm did not include the README file:
=== Tarball Contents ===
LICENSE.MIT
cli.js
index.js
package.json
Expected Behavior
=== Tarball Contents ===
README.md
LICENSE.MIT
cli.js
index.js
package.json
Steps To Reproduce
npm init
touch test
ln -s test README.md
npm publish --dry-run
Environment
- npm: 9.8.1
- Node.js: v20.2.0
- OS Name: Arch Linux
- npm config:
foreground-scripts = true
; node bin location = /usr/bin/node
; node version = v20.2.0
; npm local prefix = /home/matheus/dev/npm-test
; npm version = 9.8.1
; cwd = /home/matheus/dev/npm-test
; HOME = /home/matheus
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
Reproduce the issue with the shown npm init, test file, symlinked README.md, and npm publish --dry-run commands. Inspect how the package contents are assembled from package.json and the README.md symlink; done means the dry-run tarball contents include README.md as shown in the expected output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, release
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100