mozjpeg-bin: npm install error 7.1.1

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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 27
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

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 😂

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

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