Skip to content

Instantly share code, notes, and snippets.

@MirKml
Last active December 30, 2020 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MirKml/ad83877a3eb1c71353cd6aa021f4cbcc to your computer and use it in GitHub Desktop.
Save MirKml/ad83877a3eb1c71353cd6aa021f4cbcc to your computer and use it in GitHub Desktop.

On each Azure Pipelines agent docker image, there is installed node.js in special directory. You can utilize this one for your task, so there isn't necessary to install node.js into your build machine.

Node is currently in version 10 in special directory /azp/agent/externals/node10" inside Azure Pipelines agent. For runninng your node.js scripts directly

  1. Adjust the PATH environment variable in first pipeline Bash task, use this inline code
 # adjust PATH variable, is preserved for subsequent tasks
 echo "##vso[task.setvariable variable=PATH]$PATH:/azp/agent/externals/node10/bin"
  1. Call your node.js script directly as bash script task, node.js script must use shebang
#!/usr/bin/env node
console.log("Hello from node task")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment