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

npm install error 7.1.1 #67

Closed
efrenpastor opened this issue Oct 14, 2021 · 16 comments
Closed

npm install error 7.1.1 #67

efrenpastor opened this issue Oct 14, 2021 · 16 comments

Comments

@efrenpastor
Copy link

efrenpastor commented Oct 14, 2021

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

@jakejarvis
Copy link

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

@1000ch
Copy link
Contributor

1000ch commented Oct 18, 2021

@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?

@timbiles
Copy link

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

@1000ch
Copy link
Contributor

1000ch commented Oct 22, 2021

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

@timbiles
Copy link

timbiles commented Oct 22, 2021

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.

@1000ch
Copy link
Contributor

1000ch commented Oct 23, 2021

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

@seanpmaxwell
Copy link

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 ]

@1000ch
Copy link
Contributor

1000ch commented Oct 24, 2021

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

@fdeberle
Copy link

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

@thasmo
Copy link

thasmo commented Oct 27, 2021

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

@neo
Copy link

neo commented Nov 1, 2021

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 😂

@richard-balakrishnan
Copy link

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.

@tolixian
Copy link

tolixian commented Nov 3, 2021

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

pshiu added a commit to openedx-unsupported/frontend-app-payment that referenced this issue Nov 3, 2021
Note: There is a known issue in mozjpeg@7.1.1:

imagemin/mozjpeg-bin#67

This may throw errors in the dev build. However, since it is a
devDependency, it should not affect the prod build.

Workarounds:
* Pin mozjpeg@7.0.0 locally.
* Install nasm in your frontend-app-payment devstack shell.

Note mozjpeg@7.1.0 contains 1 high vulnerability.
pshiu added a commit to openedx-unsupported/frontend-app-payment that referenced this issue Nov 3, 2021
Note: There is a known issue in mozjpeg@7.1.1:

imagemin/mozjpeg-bin#67

This may throw errors in the dev build. However, since it is a
devDependency, it should not affect the prod build.

Workarounds:
* Pin mozjpeg@7.1.0 locally.
* `apt-get install nasm` in your frontend-app-payment devstack shell.

Note mozjpeg@7.1.0 contains 1 high vulnerability.
@1000ch
Copy link
Contributor

1000ch commented Nov 10, 2021

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

@1000ch 1000ch closed this as completed Nov 10, 2021
seunghoh added a commit to enactjs/docs that referenced this issue Dec 28, 2021
…ozjpeg-bin#67 (comment)

Enact-DCO-1.0-Signed-off-by: Seungho Park <seunghoh.park@lge.com>
nikukyugamer added a commit to true-runes/suikoden-election-2022-frontend that referenced this issue May 4, 2022
@tommym9
Copy link

tommym9 commented Oct 11, 2022

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

@uiosun
Copy link

uiosun commented Nov 9, 2022

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.

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