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

"Error: libjpeg.so.8: cannot open shared object file: No such file or directory" #106

Open
sabreenakp opened this issue Nov 14, 2017 · 11 comments
Labels

Comments

@sabreenakp
Copy link

Installed https://www.npmjs.com/package/qr-js for my Node.js app, It's working perfectly in my local system ubuntu 14.04 but after I build and deploy the app in AWS EC2 I couldn't log in to my application and showing Failed to load resource: net:: ERR_CONNECTION_REFUSED error and i found the error logs containing

Error: libjpeg.so.8: cannot open shared object file: No such file or directory"

What is the reason for this error? How can I configure AWS EC2 such that qr-js can be used?

@neocotic
Copy link
Owner

@sabreenakp Unfortunately, qr-js is no longer supported and has been deprecated in favour of QRious. Also, I'm afraid I cannot help you without knowing exactly what your code is doing or a reproducible example.

You may want to consider upgrading to QRious first in case there's an issue with one of qr-js' old dependencies (i.e. node-canvas). Install node-qrious and give that a shot and maybe your issue will disappear. If not, I'll need more information in order to help, however, this could be an issue specific to AWS EC2, which I'm not sure how to fix.

My main recommendation would be to ensure that your instance has all of the dependencies for node-canvas installed. This will be relevant for both qr-js and QRious:

https://github.com/Automattic/node-canvas/tree/v1.6.7#installation

I found this page on the node-canvas wiki. Perhaps it will help: https://github.com/Automattic/node-canvas/wiki/Installation---Amazon-Linux-AMI-(EC2)

By the nature of your error, I doubt it's an issue with this library, and most likely an issue with one of its dependencies and/or your installation.

@sabreenakp
Copy link
Author

@neocotic I tried node-qrious and according to https://github.com/Automattic/node-canvas/wiki/Installation---Amazon-Linux-AMI-(EC2) i tried to install node-canvas

after running this command - sudo yum install cairo-devel libjpeg-turbo-devel giflib-devel -y

i got response as below-
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable

then i tried yum repolist all to see the repolist but got response as repolist: 0

@neocotic
Copy link
Owner

@sabreenakp I'm not sure how to help you here. Might be worth asking on node-canvas instead as this is outside of the scope of QRious.

@sabreenakp
Copy link
Author

Can I use QRious in node.js? I tried and

sudo npm install --save --no-optional qrious

const QRious = require('qrious');
const qr = new QRious({
value: 'abcd' });
qrcode=qr.toDataURL();

and got document not defined error

@neocotic
Copy link
Owner

QRious was designed to be modular and split into multiple packages:

  • qrious - browser version
  • node-qrious - node version
  • qrious-core - contains shared QR code generation logic

@sabreenakp
Copy link
Author

Yeah, I used node-qrous also
File: /node_modules/canvas/lib/bindings.js

"Error: libjpeg.so.8: can not open shared object file: No such file or directory"

same error as using qr-js

@neocotic
Copy link
Owner

It must be an issue with your node-canvas installation then, which is a separate project that QRious depends on.

@sabreenakp
Copy link
Author

Can i use angular-qrious on my client side and get base64 url inside my component?

@neocotic
Copy link
Owner

I don't own or maintain that package so I'm not familiar with it, but it sounds like it. The pure QRious lib could also be used for client side rendering.

@electrotiti
Copy link

Sorry If, I'm going to be "Mr.Obvious" here but in my case the problem was just package version problem. Some distribution like Debian Jessie install libjpeg.so.62 instead of libjpeg.so.8 when you ask to install libjpeg-dev package. So check the version of libpeg you have in your system.
For example for the Debian Jessie: https://packages.debian.org/wheezy/amd64/libjpeg8/download

@bhaprayan
Copy link

That or compiling from source works too: http://www.ijg.org/files/
Make sure to use jpegsrc.v8.tar.gz if you're on a Unix like system though (jpegsr8.zip appears to be the MS version, throws all standard formatting errors while building :/ )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants