7

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>
Atul
  • 1,560
  • 5
  • 30
  • 75

1 Answers1

2

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