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

Cannot install imagemin-mozjpeg #71

Closed
rohitkhatri opened this issue Oct 24, 2021 · 2 comments
Closed

Cannot install imagemin-mozjpeg #71

rohitkhatri opened this issue Oct 24, 2021 · 2 comments

Comments

@rohitkhatri
Copy link

rohitkhatri commented Oct 24, 2021

I'm trying to install imagemin-mozjpeg but It's throwing error on build, It was working before but suddenly It stopped installing using npm install

Here's the package.json file:

{
    "name": "API",
    "version": "1.0.0",
    "description": "API",
    "main": "server.js",
    "scripts": {
        "start": "node server"
    },
    "dependencies": {
        "express": "^4.17.1",
        "file-type": "^14.6.2",
        "ghostscript4js": "^3.2.1",
        "imagemin": "^8.0.1",
        "imagemin-mozjpeg": "^9.0.0",
        "imagemin-pngquant": "^9.0.2",
        "imagemin-webp": "^6.0.0"
    }
}

Below is the error:

#9 53.75 make: Entering directory '/src/node_modules/ghostscript4js/build'                                                                                                
#9 53.76   CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o                                                                                          
#9 53.85   AR(target) Release/obj.target/../node-addon-api/src/nothing.a                                                                                                  
#9 53.87   COPY Release/nothing.a                                                                                                                                         
#9 53.89   CXX(target) Release/obj.target/ghostscript4js/src/ghostscript4js.o
#9 56.59   SOLINK_MODULE(target) Release/obj.target/ghostscript4js.node
#9 56.71   COPY Release/ghostscript4js.node
#9 56.72 make: Leaving directory '/src/node_modules/ghostscript4js/build'
#9 59.85   ⚠ Command failed: /src/node_modules/cwebp-bin/vendor/cwebp -version
#9 59.85 /src/node_modules/cwebp-bin/vendor/cwebp: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory
#9 59.85 
#9 59.85 
#9 59.85   ⚠ cwebp pre-build test failed
#9 59.85   ℹ compiling from source
#9 116.3   ✔ cwebp built successfully
#9 121.7 Command failed: /src/node_modules/mozjpeg/vendor/cjpeg -version
#9 121.7 /src/node_modules/mozjpeg/vendor/cjpeg: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /src/node_modules/mozjpeg/vendor/cjpeg)
#9 121.7 
#9 121.7 
#9 121.8 mozjpeg pre-build test failed
#9 121.8 compiling from source
#9 137.4 Error: Command failed: /bin/sh -c ./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8  --prefix="/src/node_modules/mozjpeg/vendor" --bindir="/src/node_modules/mozjpeg/vendor" --libdir="/src/node_modules/mozjpeg/vendor"
#9 137.4 configure: error: no nasm (Netwide Assembler) found
#9 137.4 
#9 137.4 checking for a BSD-compatible install... /usr/bin/install -c
#9 137.4 checking whether build environment is sane... yes
#9 137.4 checking for a thread-safe mkdir -p... /bin/mkdir -p
#9 137.4 checking for gawk... no
#9 137.4 checking for mawk... mawk
#9 137.4 checking whether make sets $(MAKE)... yes
#9 137.4 checking whether make supports nested variables... yes
#9 137.4 checking whether make supports nested variables... (cached) yes
#9 137.4 checking for style of include used by make... GNU
#9 137.4 checking for gcc... gcc
#9 137.4 checking whether the C compiler works... yes
#9 137.4 checking for C compiler default output file name... a.out
#9 137.4 checking for suffix of executables... 
#9 137.4 checking whether we are cross compiling... no
#9 137.4 checking for suffix of object files... o
#9 137.4 checking whether we are using the GNU C compiler... yes
#9 137.4 checking whether gcc accepts -g... yes
#9 137.4 checking for gcc option to accept ISO C89... none needed
#9 137.4 checking whether gcc understands -c and -o together... yes
#9 137.4 checking dependency style of gcc... none
#9 137.4 checking how to run the C preprocessor... gcc -E
#9 137.4 checking for gcc... (cached) gcc
#9 137.4 checking whether we are using the GNU C compiler... (cached) yes
#9 137.4 checking whether gcc accepts -g... (cached) yes
#9 137.4 checking for gcc option to accept ISO C89... (cached) none needed
#9 137.4 checking whether gcc understands -c and -o together... (cached) yes
#9 137.4 checking dependency style of gcc... (cached) none
#9 137.4 checking for ar... ar
#9 137.4 checking the archiver (ar) interface... ar
#9 137.4 checking dependency style of gcc... none
#9 137.4 checking the archiver (ar) interface... (cached) ar
#9 137.4 checking build system type... x86_64-pc-linux-gnu
#9 137.4 checking host system type... x86_64-pc-linux-gnu
#9 137.4 checking how to print strings... printf
#9 137.4 checking for a sed that does not truncate output... /bin/sed
#9 137.4 checking for grep that handles long lines and -e... /bin/grep
#9 137.4 checking for egrep... /bin/grep -E
#9 137.4 checking for fgrep... /bin/grep -F
#9 137.4 checking for ld used by gcc... /usr/bin/ld
#9 137.4 checking if the linker (/usr/bin/ld) is GNU ld... yes
#9 137.4 checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
#9 137.4 checking the name lister (/usr/bin/nm -B) interface... BSD nm
#9 137.4 checking whether ln -s works... yes
#9 137.4 checking the maximum length of command line arguments... 1572864
#9 137.4 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
#9 137.4 checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
#9 137.4 checking for /usr/bin/ld option to reload object files... -r
#9 137.4 checking for objdump... objdump
#9 137.4 checking how to recognize dependent libraries... pass_all
#9 137.4 checking for dlltool... no
#9 137.4 checking how to associate runtime and link libraries... printf %s\n
#9 137.4 checking for archiver @FILE support... @
#9 137.4 checking for strip... strip
#9 137.4 checking for ranlib... ranlib
#9 137.4 checking command to parse /usr/bin/nm -B output from gcc object... ok
#9 137.4 checking for sysroot... no
#9 137.4 checking for a working dd... /bin/dd
#9 137.4 checking how to truncate binary pipes... /bin/dd bs=4096 count=1
#9 137.4 checking for mt... no
#9 137.4 checking if : is a manifest tool... no
#9 137.4 checking for ANSI C header files... yes
#9 137.4 checking for sys/types.h... yes
#9 137.4 checking for sys/stat.h... yes
#9 137.4 checking for stdlib.h... yes
#9 137.4 checking for string.h... yes
#9 137.4 checking for memory.h... yes
#9 137.4 checking for strings.h... yes
#9 137.4 checking for inttypes.h... yes
#9 137.4 checking for stdint.h... yes
#9 137.4 checking for unistd.h... yes
#9 137.4 checking for dlfcn.h... yes
#9 137.4 checking for objdir... .libs
#9 137.4 checking if gcc supports -fno-rtti -fno-exceptions... no
#9 137.4 checking for gcc option to produce PIC... -fPIC -DPIC
#9 137.4 checking if gcc PIC flag -fPIC -DPIC works... yes
#9 137.4 checking if gcc static flag -static works... yes
#9 137.4 checking if gcc supports -c -o file.o... yes
#9 137.4 checking if gcc supports -c -o file.o... (cached) yes
#9 137.4 checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
#9 137.4 checking dynamic linker characteristics... GNU/Linux ld.so
#9 137.4 checking how to hardcode library paths into programs... immediate
#9 137.4 checking whether stripping libraries is possible... yes
#9 137.4 checking if libtool supports shared libraries... yes
#9 137.4 checking whether to build shared libraries... no
#9 137.4 checking whether to build static libraries... yes
#9 137.4 checking whether ln -s works... yes
#9 137.4 checking for pkg-config... /usr/bin/pkg-config
#9 137.4 checking pkg-config is at least version 0.9.0... yes
#9 137.4 checking size of size_t... 8
#9 137.4 checking whether compiler supports pointers to undefined structures... yes
#9 137.4 checking whether __SUNPRO_C is declared... no
#9 137.4 checking for pow in -lm... yes
#9 137.4 checking for libpng... yes
#9 137.4 checking for ANSI C header files... (cached) yes
#9 137.4 checking stddef.h usability... yes
#9 137.4 checking stddef.h presence... yes
#9 137.4 checking for stddef.h... yes
#9 137.4 checking for stdlib.h... (cached) yes
#9 137.4 checking locale.h usability... yes
#9 137.4 checking locale.h presence... yes
#9 137.4 checking for locale.h... yes
#9 137.4 checking for string.h... (cached) yes
#9 137.4 checking for sys/types.h... (cached) yes
#9 137.4 checking for an ANSI C-conforming const... yes
#9 137.4 checking whether char is unsigned... no
#9 137.4 checking for inline... inline
#9 137.4 checking for size_t... yes
#9 137.4 checking for unsigned char... yes
#9 137.4 checking for unsigned short... yes
#9 137.4 checking if right shift is signed... yes
#9 137.4 checking for memset... yes
#9 137.4 checking for memcpy... yes
#9 137.4 checking libjpeg API version... 8.0
#9 137.4 checking libjpeg shared library version... 8.1.2
#9 137.4 checking whether the linker supports version scripts... yes (GNU style)
#9 137.4 checking whether to use version script when building mozjpeg... yes
#9 137.4 checking for inline... inline __attribute__((always_inline))
#9 137.4 checking whether to include arithmetic encoding support... yes
#9 137.4 checking whether to include arithmetic decoding support... yes
#9 137.4 checking whether to use 12-bit samples... no
#9 137.4 checking whether to build TurboJPEG C wrapper... yes
#9 137.4 checking whether to build TurboJPEG Java wrapper... no
#9 137.4 checking if we have SIMD optimisations for cpu type... yes (x86_64)
#9 137.4 checking for nasm... no
#9 137.4 checking for nasmw... no
#9 137.4 checking for yasm... no
#9 137.4 
#9 137.4     at /src/node_modules/bin-build/node_modules/execa/index.js:231:11
#9 137.4     at runMicrotasks (<anonymous>)
#9 137.4     at processTicksAndRejections (internal/process/task_queues.js:95:5)
#9 137.4     at async Promise.all (index 0)
------
executor failed running [/bin/sh -c npm install --production --quite --silent]: exit code: 1

If I remove imagemin-mozjpeg, npm install works fine

Can anyone please help me here?

@rohitkhatri rohitkhatri changed the title Not about the install imagemin-mozjpeg Cannot install imagemin-mozjpeg Oct 24, 2021
@Develliot
Copy link

I think the fix for this is to bump "mozjpeg": "^7.0.0" to "mozjpeg": "^8.0.0"

I think there is an issue with "mozjpeg": ^7.1.0 fixed in 8

you can fix the build in linux by adding "mozjpeg": "7.0.0", in your project deps to force an earlier version but this will break builds for mac os

@1000ch
Copy link
Contributor

1000ch commented Dec 17, 2021

121.7 /src/node_modules/mozjpeg/vendor/cjpeg: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /src/node_modules/mozjpeg/vendor/cjpeg)

mozjpeg requires ZLIB as the error log says. Please make sure to install related dependencies like imagemin/mozjpeg-bin#67 (comment).

@1000ch 1000ch closed this as completed Dec 17, 2021
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

3 participants