I want to run a Bash script in an Azure DevOps Pipeline, see below my yaml file:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: 'Install Node.js'
- task: Bash@3
inputs:
targetType: 'filePath'
filePath: 'build.sh'
The pipeline is calling a "build.sh" script that calls node.js, and that is why I install the tool before running the script. However, I get the following message:
/home/vsts/work/1/s/build.sh: line 5: nodejs: command not found
This is the line 5 in the "build.sh" script, and it is working when I run it directly from my computer:
nodejs ../bin/r.js -o baseUrl=. optimize=none name=main out=main-built.js exclude=jquery.js
I have tried different approaches but cannot make it work. Any hint?