Server - VSTS
Agent - Hosted or Private:
I am trying to build angular cli 6.0 code using ng build --prod
When attempting this command :
2018-06-21T06:37:53.3985197Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" run build-prod"
2018-06-21T06:37:55.0603785Z You are running version v6.9.1 of Node.js, which is not supported by Angular CLI v6.
2018-06-21T06:37:55.0604039Z
2018-06-21T06:37:55.0604749Z The official Node.js version that is supported is 8.9 and greater.
I then tried to upgrade npm on the agent i get insufficient rights.
2018-06-21T07:06:30.3871805Z npm-windows-upgrade v4.1.0
2018-06-21T07:06:34.7371458Z Checked system for npm installation:
2018-06-21T07:06:34.7373057Z According to PowerShell: C:\Program Files\nodejs
2018-06-21T07:06:34.7373361Z According to npm: C:\NPM\Modules
2018-06-21T07:06:34.7373585Z Decided that npm is installed in C:\Program Files\nodejs
2018-06-21T07:06:34.7377962Z Upgrading npm...
2018-06-21T07:06:35.4158099Z
2018-06-21T07:06:35.4158702Z
2018-06-21T07:06:35.4162047Z
2018-06-21T07:06:35.4162219Z NPM cannot be upgraded without administrative rights. To run PowerShell as Administrator,
2018-06-21T07:06:35.4162362Z right-click PowerShell and select 'Run as Administrator'.
2018-06-21T07:06:35.4935679Z ##[error]Cmd.exe exited with code '1'.
Worked using Hosted 2017 build agent queue, thanks.
You can also use the Node Tool Installer task to install any version you want.
Aha! Now using that one, works like a charm, thanks!
Cool!
Most helpful comment
You can also use the Node Tool Installer task to install any version you want.