Hi Team
I'm trying to build a project on my local machine using the command " mvn clean install -PautoInstallSinglePackage" and getting this error "[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.0:install-node-and-npm (install node and npm) on project the digital.ui.frontend: Could not download npm: Could not download https://registry.npmjs.org/npm/-/npm-6.14.0.tgz: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target ".
I followed the below steps to resolve this issue but still getting an error.
- Download certificates from NodeJS site (I downloaded the whole certificate chain).
- 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
- Run your Maven command with additional arguments:-Djavax.net.ssl.trustStore="<Path to cacerts.jks>" -Djavax.net.ssl.trustStorePassword=changeit
Thanks, Advance