gpt4 book ai didi

angular - 为什么 ng build 在 azure DevOps 上失败?

转载 作者:行者123 更新时间:2023-12-04 01:38:35 25 4
gpt4 key购买 nike

我正在尝试使用 Azure devops 执行 CI/CD,但以下任务失败了。

这是 package.json 文件信息:

"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",

这是错误信息:

Error message enter image description here

我尝试删除 --prod,创建自定义构建参数,并编辑 Yaml 以手动调用 ng build

最佳答案

在您的环境中设置了以下 npm 和节点版本:

npm 6.9.0
node 10.16.3

有一个问题,npm 不支持这个 node.js 版本:https://github.com/nodejs/help/issues/2134 .

要修复您需要添加“Node.js 工具安装程序”任务以将 node.js 版本设置为支持的 8.11.2(或检查您使用的版本),在您的管道中执行 npm 安装任务之前: enter image description here

关于angular - 为什么 ng build 在 azure DevOps 上失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58512504/

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