Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install node through Front End Maven Plugin due to certificate error

I am not able to install npm and node when I run front end maven plugin

I get below error :

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:install-node-and-npm (install node and npm) on project : Could not download Node.js from: https://nodejs.org/dist/v0.9.9/x64/node.exe: Could not download https://nodejs.org/dist/v0.9.9/x64/node.exe: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]

Since this is certificate related issue , I have done below steps to resolve this issue :

1)Extracted the certificate from Node site

2)Install certificate by keytool command in JDK/JRE/LIB/Security in keystore cacerts

3)Certificate installed successfully

Stil I am getting same issue .

I am really not able to resolve this issue

Can anybody help please ?

Configurations :

<configuration>
        <nodeVersion>v8.9.1</nodeVersion>
        <npmVersion>6.1.0</npmVersion>
</configuration>
like image 497
Atul Avatar asked Nov 16 '22 16:11

Atul


1 Answers

Please follow these steps:

  1. Download certificates from NodeJS site (I downloaded the whole certificate chain).
  2. Locate your Java truststore "cacerts.jks" and import the certificates using the following command (unless you didn't change the password you may use the default password "changeit", be aware of the right order and start with the root certificate): keytool -import -v -trustcacerts -alias nodejs -file "<Path to downloaded certificate>" -keystore "<Path to cacerts.jks>" -keypass changeit -storepass changeit
  3. Run your Maven command with additional arguments:-Djavax.net.ssl.trustStore="<Path to cacerts.jks>" -Djavax.net.ssl.trustStorePassword=changeit
like image 197
Michael Grath Avatar answered Dec 31 '22 16:12

Michael Grath