Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: self signed certificate in certificate chain when running the command: npx playwright install

I run

npx playwright install

in vs code terminal and getting the next error:

Failed to install browsers
Error: Failed to download Chromium 102.0.5005.40 (playwright build v1005), caused by
Error: self signed certificate in certificate chain
    at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34)
    at TLSSocket.emit (node:events:527:28)
    at TLSSocket._finishInit (node:_tls_wrap:946:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12)

what can be the issue? Thanks for advance!

like image 239
Good Programmer Avatar asked Oct 23 '25 16:10

Good Programmer


2 Answers

NODE_TLS_REJECT_UNAUTHORIZED=0 npx playwright install

use this if you are trying in mac os

like image 123
HYPeR YASH Avatar answered Oct 26 '25 06:10

HYPeR YASH


I work behind a netskope proxy. They way I got past the self signed cert in chain error is to set the NODE_EXTRA_CA_CERTS using a powershell command.

Open a powershell command window and enter the following being sure to update the file path to your cert

$Env:NODE_EXTRA_CA_CERTS="C:\certs\root.crt"

You can find more out here https://playwright.dev/python/docs/browsers

like image 31
Mitchell Stone Avatar answered Oct 26 '25 06:10

Mitchell Stone