gpt4 book ai didi

node.js - 无法解决org.nodejs:本地生成错误

转载 作者:行者123 更新时间:2023-12-03 05:07:50 25 4
gpt4 key购买 nike

我有一个从另一个存储库派生的Angular-App,他们在其中管理管道中的所有构建。

我想在我的本地系统(笔记本电脑)中构建它,然后将内置的应用程序推送到托管服务器中。

这是他们的build.gradle

node {
version = "9.4.0"
npmVersion = "5.6.0"
download = true
}

task cleanProd(type: Delete) {
delete "dist"
}

task testProd(type: NodeTask, dependsOn: npmInstall) {
script = file("${projectDir}/node_modules/@angular/cli/bin/ng")
args = ["test", "--browsers", "PhantomJS", "--watch=false", "--singleRun=true"]
}

task assembleProd(type: NodeTask, dependsOn: ['npmInstall', 'testProd']) {
script = file("${projectDir}/node_modules/@angular/cli/bin/ng")
args = ["build", "--prod", "--vendor-chunk=true"]
}

task copyDist(type: Copy) {
from "dist/"
into "dist/fancy-ui-${project.version}"
}

task buildProd(dependsOn: [assembleProd])

我执行了 gradlew cleanProd buildProd copyDist命令,并且遇到了以下异常
Build Version = build-713-ge359ca9
:cleanProd UP-TO-DATE
:nodeSetup FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':nodeSetup'.
> Could not resolve all dependencies for configuration 'detachedConfiguration1'.
> Could not resolve org.nodejs:node:9.4.0.
Required by:
:portal-ui:build-713-ge359ca9
> Could not resolve org.nodejs:node:9.4.0.
> Could not get resource 'https://nodejs.org/dist/v9.4.0/ivy.xml'.
> Could not GET 'https://nodejs.org/dist/v9.4.0/ivy.xml'.
> nodejs.org

我拥有所有必需的 HTTP-Proxies,因此连接没有问题..只是该资源 https://nodejs.org/dist/v9.4.0/ivy.xml没有被加载..但是在 Jenkins服务器中建立了相同的代码和配置

最佳答案

我在节点10.14.1上遇到了同样的问题。

有一种解决方法可以解决此问题:

repositories.whenObjectAdded {
if (it instanceof IvyArtifactRepository) {
metadataSources {
artifact()
}
}
}

摘自 https://github.com/srs/gradle-node-plugin/issues/301

关于node.js - 无法解决org.nodejs:本地生成错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54824456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com