Publish and restore npm packages from the command line
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018
Follow this quick tutorial to learn how to connect your npm client to your feed and publish your packages using the command line. If you don't have a feed yet, you can follow the steps in the quickstart to Create your own feed.
Project setup
Navigate to your project,and then select Artifacts then select Connect to feed.
Select npm from the left navigation panel, and then follow the instructions under Project setup to configure your .npmrc file and connect to your feed. If this is your first time using Azure Artifacts with npm on your machine, make sure you select Get the tools to download and install the prerequisites.
Publish packages
Open a command prompt window and navigate to the directory that contains your package.json. If you don't have a package.json file, run the following command:
npm init
Run the following command in your project directory to publish your npm packages:
npm publish
Restore packages
Run the following command in your project directory to restore your npm packages:
npm install
Related articles
Feedback
Submit and view feedback for