huggingface / huggingface/transformers.js

NPM Package fails to install on AIX or IBM i systems because of "sharp" dependency

Open
#636 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
16.3k
Forks
1.2k
Avg merge
6d 2h
Merged PRs (30d)
6

Description

### System Info

AIX, IBM i system.

### Environment/Platform

- [ ] Website/web-app
- [ ] Browser extension
- [X] Server-side (e.g., Node.js, Deno, Bun)
- [ ] Desktop app (e.g., Electron)
- [ ] Other (e.g., VSCode extension)

### Description

Is it possible to make "sharp" an optional dependency since it is only needed if used for images.

Otherwise, the @xenova/transformers package fails to install on AIX / IBM i systems because "sharp" hasn't built binaries for those systems.

### Reproduction

On an IBM i system, use this: **npm i @xenova/transformers**

The following error occurs:
npm ERR! code 1
npm ERR! path /home/ALEXR/llamaindex-testing/test-xenova-transformers/node_modules/sharp
npm ERR! command failed
npm ERR! command /QOpenSys/pkgs/bin/bash -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-os400-ppc64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: Prebuilt libvips 8.14.5 binaries are not yet available for os400-ppc64

npm ERR! A complete log of this run can be found in: /home/ALEXR/.npm/_logs/2024-03-09T03_03_24_863Z-debug-0.log

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.