英文:
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
答案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:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论