为什么ng build在azureDevOps上失败? [英] Why is ng build failing on azureDevOps?

查看:40
本文介绍了为什么ng build在azureDevOps上失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Azure devops进行CI/CD,并且以下任务失败.

这是package.json文件的信息:

 脚本":{"ng":"ng","start":"ng服务","build":"ng build --prod", 

这是错误消息:

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

解决方案

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

  npm 6.9.0节点10.16.3 

有一个问题,就是npm不支持此node.js版本:

I am trying to do CI/CD with Azure devops and the below task is failing.

Here is the package.json file info:

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

Here is the error message:

I have tried removing --prod, creating a custom build argument, and editing the Yaml to manually call ng build

解决方案

In your environment the following npm and node versions are set:

npm 6.9.0
node 10.16.3

There is an issue, that npm doesn't support this node.js version: 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:

这篇关于为什么ng build在azureDevOps上失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆