-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
publishing an npm package with a specified binary does not install the binary when installed with npm #21303
Labels
Comments
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. |
wxiaoguang
pushed a commit
that referenced
this issue
Oct 8, 2022
Fix #21303 npm package.json supports binary packaging: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#bin the npm registry documents that the binary references will be attached to the abbreviated version object: https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-object unfortunately their api documentation leaves this out: https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-objectdoc which is likely to be the reason this was left out in gitea's initial implementation this response is critical for npm to install the binary in the `.bin` folder so as to be included on the users default bin path, resulting in immediate access to any binaries provided by the package
lunny
added a commit
that referenced
this issue
Oct 25, 2022
backport of #21372 for v1.17.4 ------------------- npm package.json supports binary packaging: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#bin the npm registry documents that the binary references will be attached to the abbreviated version object: https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-object unfortunately their api documentation leaves this out: https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-objectdoc which is likely to be the reason this was left out in gitea's initial implementation this response is critical for npm to install the binary in the .bin folder so as to be included on the users default bin path, resulting in immediate access to any binaries provided by the package i have tested upload and installing through npm and can confirm the npm registry now responds with bin in the version metadata and results in the binary being available after install. this fixes #21303 Co-authored-by: eleith <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
npm allows packages to install binary files through the use of the
bin
parameter as specified in their docsusing gitea's npm registry, i've noticed my packages will not install the binaries specified by it's
package.json
into thenode_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 runningnpm info
. as an example, ncu's registry shows that abin
property is listed out on eachversion
with gitea's registry, the
bin
property is missing (ex:https://example.com/api/packages/{owner}/npm/{@scope}/{package}
) from theversion
field and thus also does not show up when runningnpm 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
The text was updated successfully, but these errors were encountered: