tinify / tinify-nodejs

Node.js client for the Tinify API.
https://tinypng.com/developers
MIT License
414 stars 74 forks source link

Error: ENOENT: no such file or directory, open '/var/www/visbanking.com/node_modules/tinify/lib/tinify/../data/cacert.pem #33

Open Jorge644240 opened 2 years ago

Jorge644240 commented 2 years ago

When running my node.js server, on any machine, for the first time, it throws this error. I solved it on my laptop by uninstalling and installing the package again, but since I don't have root user access to my company's AWS server, I can't do that there. So I decided to check the file system for the file that's supposed to be missing, and found out that when installing the package there is no 'data' folder inside the lib directory even though it does exist here on the GitHub repo.

stvrsdagkalakis commented 2 years ago

Possible duplicate of issue #30. Are you using a bundler?

Jorge644240 commented 2 years ago

No. I'm using tinify on the backend.

rkoopmans commented 2 years ago

Hi Jorge,

Sorry for the late response.

Could you share steps to reproduce?

mauriciomassaia commented 1 month ago

I know this issue still open and there isn't a proper solution. So I ended up using this postinstall script to inject the cacert.pem into the Client.js and I was able to use it properly. https://gist.github.com/mauriciomassaia/d766fd157b16c48d9cbe2af7ef56a44d