NodeTool@0 - Node.js tool installer v0 task

Use this task to find, download, and cache a specified version of Node.js and add it to the PATH.

There is a newer version of the task available. For more information, see UseNode@1.

Syntax

# Use Node.js ecosystem v0
# Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH.
- task: NodeTool@0
  inputs:
    versionSource: 'spec' # 'spec' | 'fromFile'. Required. Source of version. Default: spec.
    #versionSpec: '6.x' # string. Optional. Use when versionSource = spec. Version Spec. Default: 6.x.
    #versionFilePath: # string. Optional. Use when versionSource = fromFile. Path to the .nvmrc file. 
    #checkLatest: false # boolean. Check for Latest Version. Default: false.
    #force32bit: false # boolean. Use 32 bit version on x64 agents. Default: false.
  # Advanced
    #nodejsMirror: 'https://nodejs.org/dist' # string. Set source for Node.js binaries. Default: https://nodejs.org/dist.
    #retryCountOnDownloadFails: '5' # string. Set retry count when nodes downloads failed. Default: 5.
    #delayBetweenRetries: '1000' # string. Set delay between retries. Default: 1000.
# Use Node.js ecosystem v0
# Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH.
- task: NodeTool@0
  inputs:
    versionSource: 'spec' # 'spec' | 'fromFile'. Required. Source of version. Default: spec.
    #versionSpec: '6.x' # string. Optional. Use when versionSource = spec. Version Spec. Default: 6.x.
    #versionFilePath: # string. Optional. Use when versionSource = fromFile. Path to the .nvmrc file. 
    #checkLatest: false # boolean. Check for Latest Version. Default: false.
    #force32bit: false # boolean. Use 32 bit version on x64 agents. Default: false.
  # Advanced
    #nodejsMirror: 'https://nodejs.org/dist' # string. Set source for Node.js binaries. Default: https://nodejs.org/dist.
# Use Node.js ecosystem v0
# Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH.
- task: NodeTool@0
  inputs:
    versionSpec: '6.x' # string. Required. Version Spec. Default: 6.x.
    #checkLatest: false # boolean. Check for Latest Version. Default: false.
    #force32bit: false # boolean. Use 32 bit version on x64 agents. Default: false.
# Use Node.js ecosystem v0
# Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH.
- task: NodeTool@0
  inputs:
    versionSpec: '6.x' # string. Required. Version Spec. Default: 6.x.
    #checkLatest: false # boolean. Check for Latest Version. Default: false.
# Use Node.js ecosystem v0
# Finds or Downloads and caches specified version spec of Node and adds it to the PATH.
- task: NodeTool@0
  inputs:
    versionSpec: '6.x' # string. Required. Version Spec. Default: 6.x.
    #checkLatest: false # boolean. Check for Latest Version. Default: false.
# YAML Syntax is not supported in TFS 2018.
# Use the classic designer to add and configure tasks.
# See the following Inputs section for details on the inputs that this task supports.

Inputs

versionSource - Source of version
string. Required. Allowed values: spec (Specify Node version), fromFile (Get version from file). Default value: spec.


versionSpec - Version Spec
string. Optional. Use when versionSource = spec. Default value: 6.x.

Specifies the version spec of the version to get. Examples: 6.x, 4.x, 6.10.0, >=6.10.0.


versionSpec - Version Spec
string. Required. Default value: 6.x.

Specifies the version spec of the version to get. Examples: 6.x, 4.x, 6.10.0, >=6.10.0.


versionFilePath - Path to the .nvmrc file
string. Optional. Use when versionSource = fromFile.

File path to get version. Example: src/.nvmrc.


checkLatest - Check for Latest Version
boolean. Default value: false.

Specifies the agent to check for the latest available version that satisfies the version spec. For example, you select this option because you run this build on your self-hosted agent, and you want to always use the latest 6.x version.

Tip

If you're using the Microsoft-hosted agents, you should leave this set to false. Microsoft updates the Microsoft-hosted agents on a regular basis, but they're often slightly behind the latest version. Enabling this parameter could result in your build spending a lot of time updating to a newer minor version.


force32bit - Use 32 bit version on x64 agents
boolean. Default value: false.

Installs the x86 version of Node regardless of the CPU architecture of the agent.


nodejsMirror - Set source for Node.js binaries
string. Default value: https://nodejs.org/dist.

Use an alternative installation mirror when sourcing the Node.js binaries.


retryCountOnDownloadFails - Set retry count when nodes downloads failed
string. Default value: 5.

Use this option when the task failed to download node binaries from the mirror. The task will retry to download the binaries for the specified times.


delayBetweenRetries - Set delay between retries
string. Default value: 1000.

Use this option to set the delay between retries in milliseconds. The default value is 1000 milliseconds.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

There is a newer version of the task available. For more information, see UseNode@1.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities Running this task satisfies the following demands for any subsequent tasks in the same job: Node, npm, node.js
Command restrictions This task runs using the following command restrictions: restricted
Settable variables This task has permission to set the following variables: PATH
Agent version 2.182.1 or greater
Task category Tool
Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities Running this task satisfies the following demands for any subsequent tasks in the same job: Node, npm, node.js
Command restrictions Any
Settable variables Any
Agent version All supported agent versions.
Task category Tool
Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities Running this task satisfies the following demands for any subsequent tasks in the same job: Node, npm
Command restrictions Any
Settable variables Any
Agent version All supported agent versions.
Task category Tool
Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities Running this task satisfies the following demands for any subsequent tasks in the same job: Node
Command restrictions Any
Settable variables Any
Agent version All supported agent versions.
Task category Tool

See also

For an explanation of tool installers and examples, see Tool installers.