Azure管道问题 – none.js版本

huangapple go评论68阅读模式
英文:

Azure pipelinne issue - none.js version

问题

I'm a little new to Azure and am trying to deploy a pipeline on azure devops from a github repo. When i try to do this, the job fails at the npm install and build stage, because 'Node.js version v10.24.1 detected. The Angular CLI requires a minimum Node.js version of either v14.20, v16.13 or v18.10.'

I've checked the version of node on my machine and its v18, however during the job, during the install node.js step, I think its using an old version of node. However I'm unsure how to change this. Log for none.js installation on azure:
Install Node.js

英文:

so I'm a little new to Azure and am trying to deploy a pipeline on azure devops from a github repo.
When i try to do this, the job fails at the npm install and build stage, because 'Node.js version v10.24.1 detected.
The Angular CLI requires a minimum Node.js version of either v14.20, v16.13 or v18.10.'

I've checked the version of node on my machine and its v18, however during the job, during the install node.js step, I think its using an old version of node. However I'm unsure how to change this. Log for none.js installation on azure:
Install Node.js

View raw log

Starting: Install Node.js

Task : Node.js tool installer
Description : Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH
Version : 0.218.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/node-js

Downloading: https://nodejs.org/dist/v10.24.1/node-v10.24.1-linux-x64.tar.gz
Extracting archive
/usr/bin/tar xC /home/vsts/work/_temp/03b1dcb9-eb8c-4670-a1e8-005b1a301667 -f /home/vsts/work/_temp/f4579837-7ffe-4b90-885d-a007e659aa26
Caching tool: node 10.24.1 x64
Prepending PATH environment variable with directory: /opt/hostedtoolcache/node/10.24.1/x64/bin
Finishing: Install Node.js

I'll inside some screenshots below for more context:
Azure管道问题 – none.js版本

Azure管道问题 – none.js版本

答案1

得分: 1

You need to configure the NodeTool@0 step to use a version spec.

Assuming you're building the pipeline with UI rather than a yml file it looks like this in the pipeline step configuration:

如果您正在使用界面而不是 yml 文件构建流水线,配置步骤如下:

If you are using a .yml file, it looks like this:

如果您正在使用 .yml 文件,配置如下:

- task: NodeTool@0
  inputs:
    versionSource: 'spec'
    versionSpec: '16.16.0'

Obviously you're free to choose whatever supported version of Node you'd like.

显然,您可以选择任何支持的 Node 版本。

英文:

You need to configure the NodeTool@0 step to use a version spec.

Assuming you're building the pipeline with UI rather than a yml file it looks like this in the pipeline step configuration:

Azure管道问题 – none.js版本

If you are using a .yml file, it looks like this:

- task: NodeTool@0
  inputs:
    versionSource: 'spec'
    versionSpec: '16.16.0'

Obviously you're free to choose whatever supported version of Node you'd like.

huangapple
  • 本文由 发表于 2023年4月17日 17:16:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76033523.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定