transformers.js
transformers.js copied to clipboard
Intallation fails on Ubuntu 22.04 due to outdated version of the package sharp
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 [email protected] 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 [email protected] install { code: 7, signal: null }
npm verb stack Error: command failed
npm verb stack at ChildProcess.<anonymous> (/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 [email protected]
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.
{
"dependencies": {
"@xenova/transformers": "2.14.2"
},
"overrides": {
"@xenova/transformers": {
"sharp": "0.33.0"
}
}
}
Reproduction
-
lxc launch ubuntu:22.04 transformers
-
lxc exec transformers -- sudo --user ubuntu --login
-
sudo snap install node --classic
-
npm install @xenova/transformers
Thanks for your investigation. We will upgrade sharp
to the latest version soon.
Thanks for your investigation. We will upgrade
sharp
to the latest version soon.
I have the same problem. When will you update it
By the way, if you use pnpm. overrides should be like this:
"pnpm": {
"overrides": {
"@xenova/transformers>sharp": "0.33.1"
}
},