npm Package Management is available with Visual Studio Team Services and TFS 2017 Update 1 and newer.
All Package Management feeds require authentication, so you'll need to store credentials for the feed before you can install or publish packages. npm uses
.npmrc configuration files to store feed URLs and credentials.
Where are my
Team Services recommends using two
- One at the root of your project that contains configuration that's shared with the whole team.
- One in your user profile folder (
~, etc. depending on your shell) that contains credentials and never leaves your machine.
This enables you to share your configuration with the whole team while keeping your credentials secure.
- For Windows users on Team Services, the vsts-npm-auth package can help you acquire and manage credentials. When you execute
vsts-npm-auth, it reads your configured package source from the provided
.npmrc, and writes credentials to your user profile
- For Mac and Linux users on Team Services, and all Team Foundation Server users, the Connect to feed dialog will generate an appropriately-formatted token that you can place into your
- Navigate to your feed. If you haven't created a feed, create one now.
- Select Connect to feed.
- Select npm.
- Follow the steps on the screen.
Team Foundation Server
If you receive an error like:
- Command Prompt:
'vsts-npm-auth' is not recognized as an internal or external command, operable program or batch file.
vsts-npm-auth : The term 'vsts-npm-auth' is not recognized as the name of a cmdlet, function, script file, or operable program.
then it's likely that the npm modules folder is not in your path.
To fix this, re-run Node.js setup and ensure the
Add to PATH option and its child options are selected for installation.
Alternatively, you can edit the PATH variable to add
%APPDATA%\npm (Command Prompt) or