imagemin / mozjpeg-bin

mozjpeg bin-wrapper that makes it seamlessly available as a local dependency

Home Page:https://github.com/mozilla/mozjpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm install error 7.1.1

efrenpastor opened this issue · comments

[node  4/21] RUN npm install
npm notice 
npm notice New major version of npm available! 7.4.3 -> 8.0.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.0.0>
npm notice Run `npm install -g npm@8.0.0` to update!``
npm notice 
npm ERR! code 1
npm ERR! path /src/node_modules/mozjpeg
npm ERR! command failed
npm ERR! command sh -c node lib/install.js
npm ERR! compiling from source
npm ERR! Command failed: /src/node_modules/mozjpeg/vendor/cjpeg -version
npm ERR! /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)
npm ERR! 
npm ERR! 
**npm ERR! mozjpeg pre-build test failed**
npm ERR! 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"
npm ERR! configure: error: no nasm (Netwide Assembler) found

Since your last change in the test file in version 7.1.1 our Build process has stopped working.
We have fixed it by locking the version to the previous one.

I am commenting this in case anyone else has this problem until it is fixed.

I can't see behind the scenes to know what happened in this commit (besides libpng12 -> libpng16) but it looks like this is what it on Linux systems, especially on common build/CI images (Vercel for me).

a36223f

Related: imagemin/imagemin-mozjpeg#70

@efrenpastor

npm ERR! /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)

It seems to require your environment to have zlib 1.2.9, could you try installing it?

Would love for there to be a fix from the package, and not have to install a previous version for something I'm not actively using (it's installed through Gatsby).

Would love for there to be a fix from the package

It would be good ideally, but sometimes dependency update on your environment needs to happen, please update your related dependencies accordingly.

Apart from the dependency, v7.1.1 includes only the chance to remove logalot... 👀

Would love for there to be a fix from the package

It would be good ideally, but sometimes dependency update on your environment needs to happen, please update your related dependencies accordingly.

Apart from the dependency, v7.1.1 includes only the chance to remove logalot... 👀

This isn't a package that I have downloaded, or are even using, unfortunately. This is a dependency from Gatsby. My point is that I would like to not rely on locking a version of a package that I am not even using.

Whatever the change was, big or small, it caused a build error -- so there is some issue that does not work in conjunction with Gatsby.

Please make sure that your environment has nasm, zlib, and automake if macOS.

# for macOS
brew install automake nasm zlib

# for Ubuntu
sudo apt-get install nasm zlib1g-dev

Also have this issue: Here's the output from sudo cat /root/.npm/_logs/2021-10-22T23_48_13_207Z-debug.log

23919 error code ELIFECYCLE
23920 error errno 1
23921 error mozjpeg@7.1.1 postinstall: `node lib/install.js`
23921 error Exit status 1
23922 error Failed at the mozjpeg@7.1.1 postinstall script.
23922 error This is probably not a problem with npm. There is likely additional logging output above.
23923 verbose exit [ 1, true ]

Does anyone still face the same issue after installing dependencies like #67 (comment)?

@jakejarvis Yes, unfortunately those additional installs do not help for my project as well. It's based on Ubuntu.

Experiencing the same issue. This was working fine with 7.0.0 for us.

W: Command failed: /app/node_modules/mozjpeg/vendor/cjpeg -version
          W: /app/node_modules/mozjpeg/vendor/cjpeg: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /app/node_modules/mozjpeg/vendor/cjpeg)
          W: 
          W: 
          W: mozjpeg pre-build test failed
          compiling from source
          W: Error: Command failed: /bin/sh -c ./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8  --prefix="/app/node_modules/mozjpeg/vendor" --bindir="/app/node_modules/mozjpeg/vendor" --libdir="/app/node_modules/mozjpeg/vendor"
          W: configure: error: no nasm (Netwide Assembler) found

just solved a similar issue:

if you're using docker or "stretch" debian (which is the default docker tagged version for node:14 and below), consider using "bullseye" or "buster" instead as it has a newer version of zlib (1.2.11 v.s. 1.2.8): https://packages.debian.org/bullseye/zlib1g

was trying to make the shipped vendor version work rather than trying to let it rebuild from source and create more dependency problems 😂

i am facing similar issue,

mozjpeg@7.1.1 postinstall D:\Richard\react-samples\node_modules\mozjpeg
node lib/install.js

Hostname/IP does not match certificate's altnames: Host: raw.githubusercontent.com. is not in the cert's altnames: DNS:api.demo.dns.simplifyd.app
mozjpeg pre-build test failed
compiling from source
Error: Command failed: C:\Windows\system32\cmd.exe /s /c "autoreconf -fiv"
'autoreconf' is not recognized as an internal or external command,
operable program or batch file.

I am facing the similar issue,
#16 186.6 > mozjpeg@7.1.1 postinstall /workspace/node_modules/mozjpeg
#16 186.6 > node lib/install.js
#16 186.6
#16 187.3 Command failed: /workspace/node_modules/mozjpeg/vendor/cjpeg -version
#16 187.3 /workspace/node_modules/mozjpeg/vendor/cjpeg: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /workspace/node_modules/mozjpeg/vendor/cjpeg)
#16 187.3
#16 187.3
#16 187.3 mozjpeg pre-build test failed

For the version 7.1.1, please make sure to install this package after #67 (comment).

Please make sure that your environment has nasm, zlib, and automake if macOS.

# for macOS
brew install automake nasm zlib

# for Ubuntu
sudo apt-get install nasm zlib1g-dev

This isn't working for me using docker (via DDEV). Installing the nasm and zlib1g-dev packages hasn't changed the error message either.

Happy to provide any debug info over, but npm isn't my forte so not sure whats going to be helpful here.

Cheers

Tom

Please make sure that your environment has nasm, zlib, and automake if macOS.

# for macOS
brew install automake nasm zlib

# for Ubuntu
sudo apt-get install nasm zlib1g-dev

This isn't working for me using docker (via DDEV). Installing the nasm and zlib1g-dev packages hasn't changed the error message either.

Happy to provide any debug info over, but npm isn't my forte so not sure whats going to be helpful here.

Cheers

Tom

Hi Tom, can you share your Dockerfile? (desensitization)

I think we can include package in Dockerfile, because the step will effect npm build, when I tested.