I'm aware that I can select the node version to use with NVM but, can I build two angular projects (with different ng version and node version) at the same time without issues? My scenario is a self-hosted build server (Windows) with two agents. Each of these might be, at the same time, on charge of building an Angular app with different version.
Regards
As @Andrei stated, is not possible to use NVM to set the Node version at the beginning of pipeline because it will change the version in all open consoles (so, if another pipeline with a different version of Node is running, would be affected).
Luckily, I found an easy workaround which does not require install additional tools or change package.json:
To add Node path only for current pipeline, we have to add a Powershell task as first task of the pipeline with the current command:
Write-Host ("##vso[task.setvariable variable=Path;]D:\LocalNode\node-v17.8.0-win-x64;$Env:Path")
Rest of the tasks of the pipeline will use the Node version from D:\LocalNode\node-v17.8.0-win-x64
If you want to create a pipeline for a different Node version, just add the version to D:\LocalNode and use the above command with the right path as first task of the pipeline. No problem if both pipelines run at the same time.