Set up your client's npmrc
Support for npm packages is available with Package Management in VSTS 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
VSTS 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 VSTS, 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 macOS, Linux, and Windows Bash Shell users on VSTS, 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.
Follow the steps on screen.
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