Publish npm packages

Azure Pipelines | TFS 2018 | TFS 2017


In Microsoft Team Foundation Server (TFS) 2018 and previous versions, build and release pipelines are called definitions, service connections are called service endpoints, stages are called environments, and jobs are called phases.

You can publish npm packages produced by your build to:

  • Azure Artifacts or the TFS Package Management service
  • Other registries such as

Before you read this topic, you should understand the kind of build pipeline you're creating: designer or YAML.

To publish to an Azure Artifacts feed, set the Project Collection Build Service identity to be a Contributor on the feed. To learn more about permissions to Package Management feeds, see Secure and share packages using feed permissions.

To publish to a external npm registry, you must first create a service connection to point to that feed. You can do this by going to Project settings, then choosing Services, and then creating a New service connection. Select the npm option for the service connection. Fill in registry URL and the credentials to connect to the registry.

To publish a package to a npm registry, add the following snippet to your azure-pipelines.yml file.

- task: Npm@1
    command: publish
    publishEndpoint: '<copy and paste the name of the service connection here>'

For a list of other options, see the npm task.

YAML is not supported in TFS.


Build does not support using the publishConfig property to specify the registry to which you're publishing. Ensure your working folder has a .npmrc file with a registry= line, as detailed in the Connect to feed screen in your feed.


Where can I learn about the Azure Pipelines and TFS Package management service?

Package Management service