Error in installing Puppeteer - SELF_SIGNED_CERT_IN_CHAIN on AWS workspace
Getting the following error while installing puppeteer. the machine is AWS workspace and I have already setup the certificate file in npmrc
D:\git>npm install puppeteer
> [email protected] install D:\git\node_modules\puppeteer
> node install.js
ERROR: Failed to set up Chromium r737027! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34)
at TLSSocket.emit (events.js:210:5)
at TLSSocket._finishInit (_tls_wrap.js:794:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12)
-- ASYNC --
at BrowserFetcher.<anonymous> (D:\git\node_modules\puppeteer\lib\helper.js:105:23)
at fetchBinary (D:\git\node_modules\puppeteer\install.js:150:27)
at download (D:\git\node_modules\puppeteer\install.js:78:9) {
code: 'SELF_SIGNED_CERT_IN_CHAIN'
}
You can disabled certificate validation for TLS connections:
NODE_TLS_REJECT_UNAUTHORIZED=0 npm install puppeteer
Try to use the Node LTS version (current 12.16.3). I solved the problem by changing from version 14.0.0
to 12.16.3
At the CMD prompt type:
set NODE_TLS_REJECT_UNAUTHORIZED=0
npm install puppeteer
It worked for me.
If you use maven (frontend-maven-plugin) the only solution that works for me is:
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<environmentVariables>
<PUPPETEER_SKIP_CHROMIUM_DOWNLOAD>true</PUPPETEER_SKIP_CHROMIUM_DOWNLOAD>
</environmentVariables>
<arguments>install --@rgi:registry=${npm.registry.url}</arguments>
</configuration>
</execution>