transformers.js icon indicating copy to clipboard operation
transformers.js copied to clipboard

Intallation fails on Ubuntu 22.04 due to outdated version of the package sharp

Open schkovich opened this issue 1 year ago • 3 comments

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

  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

schkovich avatar Jan 30 '24 16:01 schkovich

Thanks for your investigation. We will upgrade sharp to the latest version soon.

xenova avatar Feb 09 '24 00:02 xenova

Thanks for your investigation. We will upgrade sharp to the latest version soon.

I have the same problem. When will you update it

Qiu-Jun avatar Jun 24 '24 01:06 Qiu-Jun

By the way, if you use pnpm. overrides should be like this:

"pnpm": {
    "overrides": {
      "@xenova/transformers>sharp": "0.33.1"
    }
  },

Qiu-Jun avatar Jun 24 '24 01:06 Qiu-Jun