Skip to content

publishing an npm package with a specified binary does not install the binary when installed with npm #21303

Closed
@eleith

Description

@eleith

Description

npm allows packages to install binary files through the use of the bin parameter as specified in their docs

using gitea's npm registry, i've noticed my packages will not install the binaries specified by it's package.json into the node_modules/.bin as it does with other packages on other registries.

i've only lightly investigated, but this may have some overlap with the solution to #21013

with npmjs registry, the bin is listed out in the registry metadata and also shows up when running npm info. as an example, ncu's registry shows that a bin property is listed out on each version

with gitea's registry, the bin property is missing (ex: https://example.com/api/packages/{owner}/npm/{@scope}/{package}) from the version field and thus also does not show up when running npm info

my current theory is that this missing metadata may be resulting in npm not knowing a package is providing a binary and thus not installing it post install.

however, if i link my package internally, the binary is picked up and installed correctly.

Gitea Version

1.17

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker compose

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions