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

Closed
opened 2025-11-02 08:45:08 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @eleith on GitHub (Sep 30, 2022).

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

Originally created by @eleith on GitHub (Sep 30, 2022). ### Description npm allows packages to install binary files through the use of the `bin` parameter as [specified in their docs](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#bin) 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](https://registry.npmjs.org/npm-check-updates) 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
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 08:45:08 -06:00
Author
Owner

@D0ms3y commented on GitHub (Oct 3, 2022):

Ran into the same issue yesterday. I've compared the metadata of npmjs and my gitea npm registry. Adding the binary information in the metadata should fix this.

@D0ms3y commented on GitHub (Oct 3, 2022): Ran into the same issue yesterday. I've compared the metadata of npmjs and my gitea npm registry. Adding the binary information in the metadata should fix this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9639