Use Team Build to restore and publish npm packages

Last Update: 3/27/2017

Team Services

This guide covers the basics of using Team Build to work with npm packages in Package Management feeds.

This walkthrough assumes that you've already:

Install packages at the start of your build

To build a solution that relies on npm packages from Package Management feeds, add the npm task.

First, click Add build step..., select the Package category, and add the npm task. Then drag to order the task above any build tasks that require your packages.

Next, configure these options:

  • working folder: Select the folder that contains your .npmrc; leave blank if your .npmrc is at the root of the repo
  • npm command: install

Team Build npm install step configuration

Finally, save your build.

Publish a package

To publisn an npm package to a Package Management feed, add the npm task.

First, click Add build step..., select the Package category, and add the npm task. Then drag to order the task above any build tasks that require your packages.

Next, configure these options:

  • working folder: Select the folder that contains your .npmrc and package.json; leave blank if those files are at the root of the repo
  • npm command: publish

Team Build npm publish step configuration

Finally, save your build.