Beth McCoy
Beth McCoy

Reputation: 33

Azure pipelinne issue - none.js version

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: install node.js - azure pipeline

Npm install and build error

Upvotes: 0

Views: 2265

Answers (1)

craigw
craigw

Reputation: 715

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:

enter image description here

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.

Upvotes: 2

Related Questions