Node.js Tool Installer task
Use this task to find, download, and cache a specified version of Node.js and add it to the PATH.
# Node.js tool installer # 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' #force32bit: false # Optional #checkLatest: false # Optional
|(Required) Specify which Node.js version you want to use, using semver's version range syntax.
Use 32 bit version on x64 agents
|(Optional) Install the x86 version of Node.js on a 64-bit Windows agent. Only works on Windows.|
Check for Latest Version
|(Optional) Select if you want 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
If you're using the Microsoft-hosted agents, you should leave this check box cleared. We update the Microsoft-hosted agents on a regular basis, but they're often slightly behind the latest version. So selecting this box will result in your build spending a lot of time updating to a newer minor version.
This task is open source on GitHub. Feedback and contributions are welcome.
Where can I learn more about tool installers?
For an explanation of tool installers and examples, see Tool installers.
Do I need an agent?
You need at least one agent to run your build or release.
I'm having problems. How can I troubleshoot them?
I can't select a default agent pool and I can't queue my build or release. How do I fix this?
See Agent pools.
My NuGet push task is failing with the following error: "Error: unable to get local issuer certificate". How can I fix this?
This can be fixed by adding a trusted root certificate. You can either add the
NODE_EXTRA_CA_CERTS=file environment variable to your build agent, or you can add the
NODE.EXTRA.CA.CERTS=file task variable in your pipeline. See Node.js documentation for more details about this variable. See Set variables in a pipeline for instructions on setting a variable in your pipeline.