GithubHelp home page GithubHelp logo

Comments (17)

lewebsimple avatar lewebsimple commented on August 20, 2024 13

Installing the following under Ubuntu 16.04 works for me:

sudo apt-get install autoconf libtool nasm

from mozjpeg-bin.

jjwilliams42 avatar jjwilliams42 commented on August 20, 2024 11

I have no idea. I've never had an npm dependency that had an npm dependency that had an npm dependency that required an entire build chain of requirements. I spent about a day trying to get it working then gave up.

from mozjpeg-bin.

heisian avatar heisian commented on August 20, 2024 7

On Amazon EC2:

# Amazon AMI Linux
yum install autoconf automake libtool nasm

VERY not happy I have to install all this crap on my build server to get it working.

from mozjpeg-bin.

thom4parisot avatar thom4parisot commented on August 20, 2024 7

VERY not happy I have to install all this crap on my build server to get it working.

I don't feel very comfortable to read such a rude message. And I don't even develop the tool.

Some people are thinking about it and it does not seem trivial.
Maybe you can share your knowledge in #33

from mozjpeg-bin.

fiws avatar fiws commented on August 20, 2024 1

hm... CI does not like this :\

why does the pre build binary does not work in the first place?

from mozjpeg-bin.

hsz avatar hsz commented on August 20, 2024
> [email protected] postinstall /opt/bitnami/apps/jenkins/jenkins_home/jobs/Project/workspace/node_modules/mozjpeg
> node lib/install.js

  ⚠ The `/opt/bitnami/apps/jenkins/jenkins_home/jobs/Project/workspace/node_modules/mozjpeg/vendor/cjpeg` binary doesn't seem to work correctly
  ⚠ mozjpeg pre-build test failed
  ℹ compiling from source
  ✖ Error: autoreconf -fiv && ./configure --disable-shared --disable-dependency-tracking --with-jpeg8  --prefix="/opt/bitnami/apps/jenkins/jenkins_home/jobs/Project/workspace/node_modules/mozjpeg/vendor" --bindir="/opt/bitnami/apps/jenkins/jenkins_home/jobs/Project/workspace/node_modules/mozjpeg/vendor" --libdir="/opt/bitnami/apps/jenkins/jenkins_home/jobs/Project/workspace/node_modules/mozjpeg/vendor" && make -j2 && make install -j2
Command failed: ./configure --disable-shared --disable-dependency-tracking --with-jpeg8  --prefix="/opt/bitnami/apps/jenkins/jenkins_home/jobs/Project/workspace/node_modules/mozjpeg/vendor" --bindir="/opt/bitnami/apps/jenkins/jenkins_home/jobs/Project/workspace/node_modules/mozjpeg/vendor" --libdir="/opt/bitnami/apps/jenkins/jenkins_home/jobs/Project/workspace/node_modules/mozjpeg/vendor"
./configure: line 13124: PKG_PROG_PKG_CONFIG: command not found
./configure: line 13303: syntax error near unexpected token `libpng,'
./configure: line 13303: `PKG_CHECK_MODULES(libpng, libpng, HAVE_LIBPNG=1,'

    at ChildProcess.exithandler (child_process.js:270:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

from mozjpeg-bin.

jjwilliams42 avatar jjwilliams42 commented on August 20, 2024
> [email protected] postinstall /app/MYAPP/node_modules/mozjpeg
  > node lib/install.js
  
    ΓÜá The `/app/MYAPP/node_modules/mozjpeg/vendor/cjpeg` binary doesn't seem to work correctly
    ΓÜá mozjpeg pre-build test failed
    ℹ compiling from source
EXEC : Γ£û error : autoreconf -fiv && ./configure --disable-shared --prefix="/app/MYAPP/node_modules/mozjpeg/vendor" --bindir="/app/MYAPP/node_modules/mozjpeg/vendor" --libdir="/app/MYAPP/node_modules/mozjpeg/vendor" && make --jobs=2 && make install --jobs=2 [/app/MYAPP/MYAPP.csproj]
  Command failed: autoreconf -fiv
  /bin/sh: 1: autoreconf: not found
  
      at ChildProcess.exithandler (child_process.js:199:12)
      at emitTwo (events.js:106:13)
      at ChildProcess.emit (events.js:191:7)
      at maybeClose (internal/child_process.js:920:16)
      at Socket.<anonymous> (internal/child_process.js:351:11)
      at emitOne (events.js:96:13)
      at Socket.emit (events.js:188:7)
      at Pipe._handle.close [as _onclose] (net.js:497:12)

from mozjpeg-bin.

heisian avatar heisian commented on August 20, 2024

Well let's see what happens here...

yum install autoconf automake libtool nasm

This is all done so that cjpeg can be built, which seems to be a part of the standard libraries for many common flavors of linux:

https://www.unix.com/man-page/redhat/1/cjpeg/
http://manpages.ubuntu.com/manpages/xenial/man1/cjpeg.1.html
https://linux.die.net/man/1/cjpeg

That being said, one still seems to need to run the following to get cjpeg to make && make install in CentOS & Fedora: mozilla/mozjpeg#218

So how to make this happen without having sudo permissions?

Have the script download tarballs from verified sources on fixed versions and install to ~/bin or something standard for local libraries, and then compile the cjpeg binary and install into the local module folder [1].

All of these dependencies are standard and the installations and dependencies themselves can be locally cleaned up after cjpeg is compiled.

Of course it would be nice if I put this into practice and made a pull request rather than just shit-talk on a thread, wouldn't it?

So, what are your thoughts?

from mozjpeg-bin.

heisian avatar heisian commented on August 20, 2024

The point is, rather than having to pick and pull from different statically-linked libraries that may or may not exist in varying distros of linux,

it's better to pull all the dependencies and compile them from source locally without sudo such that the target binary, cjpeg, can be compiled locally and specific to the flavor of linux being run,

and then all the dependencies used to compile it can be cleaned up such that in the end, the only dependency needed in the first place, cjpeg, remains.

Such a strategy would give the widest success across the various flavors of linux, and probably BSD, but I haven't spent enough time in BSD-land.

from mozjpeg-bin.

lastboy1228 avatar lastboy1228 commented on August 20, 2024

Every time I install mozjpeg in the same project folder, it always says the cjpeg binary doesn't seem to work correctly, and rebuild it again. I don't know why.

from mozjpeg-bin.

debasishshanti avatar debasishshanti commented on August 20, 2024

@doochik @fiws Do you have a Package lock file that was generated from another OS? I faced this issue when a package-lock.json file was created in Windows system and then we tried to deploy the code in Jenkins(Linux) environment. Deleting the package-lock.json file solved the issue for me.
Hope this helps

from mozjpeg-bin.

ChinmoyDn avatar ChinmoyDn commented on August 20, 2024

Getting the same error. Removing the yarn.lock file and the node_modules, then reinstalling all the node modules solves it.
How to get over this issue?

from mozjpeg-bin.

dmitryuk avatar dmitryuk commented on August 20, 2024

same error on Centos.
After installed libpng16-dev problem was solved
https://stackoverflow.com/questions/25549536/error-while-loading-shared-libraries-libpng16

from mozjpeg-bin.

fiws avatar fiws commented on August 20, 2024

@debasishshanti you guessed right, it was generated on another os. But I recreated the package-lock on my (Linux) machine and it sadly did not fix the issue :(

from mozjpeg-bin.

debasishshanti avatar debasishshanti commented on August 20, 2024

@fiws Try not to have that Package lock file in repository and check

from mozjpeg-bin.

ChangeZhang avatar ChangeZhang commented on August 20, 2024

[email protected] postinstall /Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/mozjpeg
node lib/install.js

⚠ EACCES: permission denied, mkdir '/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/mozjpeg/vendor'
⚠ mozjpeg pre-build test failed
ℹ compiling from source
/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/onetime/index.js:15
throw new Error(fnName + ' can only be called once.');
^

Error: callback() can only be called once.
at onetime (/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/onetime/index.js:15:11)
at /Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/download/index.js:156:5
at ConcatStream. (/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/concat-stream/index.js:37:43)
at emitNone (events.js:111:20)
at ConcatStream.emit (events.js:208:7)
at finishMaybe (/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/readable-stream/lib/_stream_writable.js:630:14)
at endWritable (/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/readable-stream/lib/_stream_writable.js:638:3)
at ConcatStream.Writable.end (/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/readable-stream/lib/_stream_writable.js:594:41)
at DuplexWrapper.onend (/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/readable-stream/lib/_stream_readable.js:577:10)
at Object.onceWrapper (events.js:313:30)
npm info lifecycle [email protected]~postinstall: Failed to exec postinstall script
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node lib/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zhangwen/.npm/_logs/2019-05-20T11_41_36_101Z-debug.log

from mozjpeg-bin.

quarryman avatar quarryman commented on August 20, 2024

EACCES: permission denied, mkdir '/Users/zhangwen/Desktop/linkingfresh-project/tire/node_modules/mozjpeg/vendor'

This is most likely because you have node_modules created by root user.
Even if you are running npm i mozjpeg under root too, postinstall compiler will operate as system user (ec2-user in case of Amazon Linux for instance), so it has no rights to write to node_modules/mozjpeg to create binaries.

from mozjpeg-bin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.