Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when installing mozjpeg - mozjpeg/vendor/cjpeg ENOENT #69

Open
DavidFaizulaev opened this issue Oct 10, 2021 · 7 comments
Open

Error when installing mozjpeg - mozjpeg/vendor/cjpeg ENOENT #69

DavidFaizulaev opened this issue Oct 10, 2021 · 7 comments

Comments

@DavidFaizulaev
Copy link

I'm trying to install mozjpeg in a Docker container which runs

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.7
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

And I get the following error

yarn install --frozen-lockfile
yarn install v1.19.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @typescript-eslint/eslint-plugin@2.31.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
warning " > @typescript-eslint/eslint-plugin-tslint@2.31.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
warning " > @typescript-eslint/parser@2.31.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
warning "serverless > @serverless/components > inquirer-autocomplete-prompt@1.4.0" has unmet peer dependency "inquirer@^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0".
warning " > serverless-plugin-aws-alerts@1.7.1" has incorrect peer dependency "serverless@^2.4.0".
[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error /builds/conversion-handler/node_modules/mozjpeg: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments: 
Directory: /builds/conversion-handler/node_modules/mozjpeg
Output:
⚠ spawn /builds/conversion-handler/node_modules/mozjpeg/vendor/cjpeg ENOENT
  ⚠ mozjpeg pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c ./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8  --prefix="/builds/conversion-handler/node_modules/mozjpeg/vendor" --bindir="/builds/conversion-handler/node_modules/mozjpeg/vendor" --libdir="/builds/conversion-handler/node_modules/mozjpeg/vendor"
configure: error: in `/tmp/5165e468-cf39-4de1-843a-506698a12de7':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... no
checking for cc... no
checking for cl.exe... no
    at /builds/conversion-handler/node_modules/execa/index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)

I tried running - apk add automake autoconf libtool dpkg pkgconfig nasm libpng before calling yarn install but that did not help.

Please advise how can I resolve this?

@roberthgodoy
Copy link

+1

4 similar comments
@mejor113
Copy link

+1

@gezichenshan
Copy link

+1

@aidosmen
Copy link

+1

@xyy7260
Copy link

xyy7260 commented Dec 24, 2021

+1

@flybywind
Copy link

no one solved it ? opened for 2 years ...

@SASUPERNOVA
Copy link

SASUPERNOVA commented Feb 9, 2024

This is an issue specific to Node Alpine images, as Alpine is missing some of the dependencies required for mozjpeg. More information about what dependencies may be missing can be found here. However, different Node versions seem to require different/additional dependencies, so I have not been able to reproduce this solution on my setup. An alternative solution would be using a different image (e.g. Slim).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants