Skip to content

Latest commit

 

History

History
66 lines (41 loc) · 2.92 KB

File metadata and controls

66 lines (41 loc) · 2.92 KB
title Restore npm packages from the command line
description Learn how to authenticate with your Azure Artifacts feed and restore npm packages from the command line.
ms.service azure-devops-artifacts
ms.topic tutorial
ms.date 02/21/2025
monikerRange <=azure-devops

Restore npm packages from the command line

[!INCLUDE version-lt-eq-azure-devops]

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

Prerequisites

Product Requirements
Azure DevOps - An Azure DevOps organization.
- An Azure DevOps project.
- An Azure Artifacts feed.

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
    
  1. Download Node.js and npm.

  2. Create a Personal Access Token with Packaging > Read & write scope.


Restore 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 restore all your npm packages:

    npm install
    
  3. If you want to restore a specific package, run the following command in your project directory:

    npm install --save <PACKAGE_NAME>
    

Related content