huggingface / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
https://huggingface.co/docs/transformers.js
Apache License 2.0
12.24k stars 777 forks source link

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

Open schkovich opened 10 months ago

schkovich commented 10 months ago

System Info

transformers: 2.14.2 os: ubuntu 22.04 node: v20.11.0 npm: 10.2.4

Environment/Platform

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.<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 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.

{
    "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
xenova commented 9 months ago

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

Qiu-Jun commented 5 months ago

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 commented 5 months ago

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

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