3

I'm trying to point teamcity to use the latest npm version 6.0.1. but for some reason, it is stuck using 5.6.0.

node.js 10.1.0

node.js.npm 5.6.0

the node version gets updated.

I have tried adding npm i npm@latest -g to the build step, it runs successfully, but the teamcity agent version doesn't change.

Elena Maximova
  • 916
  • 1
  • 8
  • 15

2 Answers2

1

You must first find out where node & npm are installed at the system level. Using the usual way to upgrade npm i npm@latest -g will install npm into your user profile, it won't update that system-level installation (which is what TeamCity's build agent uses).

On my (Windows) build agent I found it at C:\nodejs but your box may vary

Open a command prompt, cd to that directory and then use npm i npm@latest (note no -g switch). This will upgrade your system-level npm installation (used by the build agent). You will likely need administrative rights to the box etc etc.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Craig Fowler
  • 372
  • 2
  • 12
-1

To solve this issue, i change the Teamcity server and agent services users from Local System to an actual User.

Login into the build server as the user and Installed npm and node. Did a server restart.

Now TC using the latest version of npm.

KreepN
  • 8,528
  • 1
  • 40
  • 58
Elena Maximova
  • 916
  • 1
  • 8
  • 15