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

2024-03-01

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

这是 package.json 文件信息:

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

这是错误消息:

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


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

npm 6.9.0
node 10.16.3

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

To fix that you need to add 'Node.js tool installer' task to settle node.js version to supported 8.11.2 (or check which version you use) one, before npm install task in your pipeline: enter image description here

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么 ng build 在 azure DevOps 上失败? 的相关文章