แก้ไข

แชร์ผ่าน


Publish npm packages from the command line

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

This article guides you through authenticating with your Azure Artifacts feed and publishing npm packages from the command line.

Prerequisites

Product Requirements
Azure DevOps - An Azure DevOps organization.
- An Azure DevOps project.
- An Azure Artifacts feed.
- Download and install Node.js and npm.

Get the tools

If this is your first time using Azure Artifacts with npm on your machine, follow the steps below to set up your environment:

  1. Download Node.js and npm.

  2. Run the following command to install vsts-npm-auth.

    npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false
    

Publish packages

  1. If you haven't authenticated with your feed yet, follow the steps in the Project setup to connect to your feed and then proceed with the next step once you're done.

  2. Run the following command in your project directory to publish the npm packages listed in your package.json:

    npm publish