Skip to content

[BUG] npm publish ignores symbolic links #6746

Description

@matheusmoreira

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 release

    Type

    No type

    Fields

    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