huggingface / huggingface/transformers.js
Intallation fails on Ubuntu 22.04 due to outdated version of the package sharp
- Dominant language
- JavaScript
- Stars
- 16.3k
- Forks
- 1.2k
- Avg merge
- 6d 2h
- Merged PRs (30d)
- 6
Description
### System Info
transformers: 2.14.2
os: ubuntu 22.04
node: v20.11.0
npm: 10.2.4
### 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
Installation fails with:
```
npm info run sharp@0.32.6 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm info run sharp@0.32.6 install { code: 7, signal: null }
npm verb stack Error: command failed
npm verb stack at ChildProcess. (/snap/node/8169/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack at ChildProcess.emit (node:events:518:28)
npm verb stack at maybeClose (node:internal/child_process:1105:16)
npm verb stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm verb pkgid sharp@0.32.6
npm verb cwd /home/ubuntu
npm verb Linux 6.2.0-39-generic
npm verb node v20.11.0
npm verb npm v10.2.4
npm ERR! code 7
npm ERR! path /home/ubuntu/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm verb exit 7
```
Expected result: successful installation
Bumping the sharp version to 0.33.0 results in a successful install.
```json
{
"dependencies": {
"@xenova/transformers": "2.14.2"
},
"overrides": {
"@xenova/transformers": {
"sharp": "0.33.0"
}
}
}
```
### Reproduction
1. `lxc launch ubuntu:22.04 transformers`
2. `lxc exec transformers -- sudo --user ubuntu --login`
3. `sudo snap install node --classic`
4. `npm install @xenova/transformers`
Contributor guide
Assessment
This issue has not been assessed yet.