运行前端maven插件时,我无法安装npm和node
我遇到以下错误:
[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]
由于这是与证书相关的问题,所以我已按照以下步骤解决了此问题:
1)从Node网站提取证书
2)通过密钥存储区 cacerts
中的JDK/JRE/LIB/Security
中的 keytool 命令安装证书
3)证书已成功安装
直到我遇到同样的问题。
我真的无法解决此问题
有人可以帮忙吗?
配置:
<configuration>
<nodeVersion>v8.9.1</nodeVersion>
<npmVersion>6.1.0</npmVersion>
</configuration>
答案 0 :(得分:0)
请按照以下步骤操作:
keytool -import -v -trustcacerts -alias nodejs -file "<Path to downloaded certificate>" -keystore "<Path to cacerts.jks>" -keypass changeit -storepass changeit
-Djavax.net.ssl.trustStore="<Path to cacerts.jks>" -Djavax.net.ssl.trustStorePassword=changeit