Azure管道节点版本不匹配问题

问题描述 投票:0回答:1

我是 Azure 新手,在运行管道时遇到问题。管道退出代码为 3

This is how error looks like.

This is configuration for node version.

有人可以帮我解决这个问题吗?

node.js azure azure-pipelines version
1个回答
0
投票

从您的屏幕截图中,它显示了错误:Angular CLI 需要 v18.13 的最低 Node.js 版本。

问题的原因是最新的 Angular CLI 版本 17.0.x 请求节点版本 18.13。

如果不设置Angular CLI版本,它将默认使用最新版本17.0.3。

要解决此问题,您可以降级 Azure Pipeline 中的 Angular CLI 版本。

例如:npm install -g @angular/[电子邮件受保护]

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '14.20.0'
  displayName: 'Install Node.js'

- script: |
    npm install -g @angular/[email protected]
    npm install
    ng build --prod
  displayName: 'npm install and build'
© www.soinside.com 2019 - 2024. All rights reserved.