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

Trying to install mozjpeg - behind corporate network #51

Open
lawrenceong001 opened this issue Dec 10, 2019 · 2 comments
Open

Trying to install mozjpeg - behind corporate network #51

lawrenceong001 opened this issue Dec 10, 2019 · 2 comments

Comments

@lawrenceong001
Copy link

hello,

i'm trying to install gatsby using a default template, which requires mozjpeg. however, i'm getting this error:

C:\dev>npm i -g mozjpeg
C:\Users\a\AppData\Roaming\npm\mozjpeg -> C:\Users\a\AppData\Roaming\npm\node_modules\mozjpeg\cli.js
`> mozjpeg@6.0.1 postinstall C:\Users\a\AppData\Roaming\npm\node_modules\mozjpeg` `> node lib/install.js`
(node:13428) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
‼ self signed certificate in certificate chain
‼ mozjpeg pre-build test failed
i compiling from source
× RequestError: self signed certificate in certificate chain
at ClientRequest.<anonymous> (C:\Users\a\AppData\Roaming\npm\node_modules\mozjpeg\node_modules\got\index.js:111:21)
at Object.onceWrapper (events.js:284:20)
at ClientRequest.emit (events.js:196:13)
at TLSSocket.socketErrorListener (_http_client.js:402:9)
at TLSSocket.emit (events.js:196:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:84:17)
+ mozjpeg@6.0.1
updated 1 package in 13.251s

I've already set strict-ssl and NODE_TLS_REJECT_UNAUTHORIZED to false, but can't seem to get around this issue.

hopefully someone can help?

tks
Lawrence

@ambroiseRabier
Copy link

Seem related to imagemin/jpegtran-bin#90.

@mikaey
Copy link

mikaey commented Sep 21, 2020

I'm behind a corporate proxy and was running into this same issue. In my case, the issue seemed to be due to the fact that mozjpeg's install script was invoking another copy of node, and node didn't have the certs for my corp's proxy. Here's how I fixed it (note that I'm on macOS):

  • Grabbed a copy of the proxy's certificate, threw it into a file called cacert.pem (openssl s_client -connect raw.githubusercontent.com:443 -showcerts >cacert.pem, then Ctrl+D after it spits out its output)
  • Run NODE_EXTRA_CA_CERTS=cacert.pem npm install

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

3 participants