Package: npm

VSTS | TFS 2017 | TFS 2015

Install and publish npm packages

Install npm packages

Demands

npm

Arguments

Argument Description
Command npm command to run. Select install here.
Working folder with package.json Path to the folder containing the target package.json and .npmrc files. Select the folder, not the file e.g. "/packages/mypackage".
Custom registries and authentication
Registries to use Leave this section blank to use packages from npmjs directly. Otherwise, select one of these options:
Registries in my .npmrc:
  • Select this option to use feeds specified in a .npmrc file you've checked into source control.
    • Credentials for registries outside this account/collection can be used to inject credentials you've provided as an npm service endpoint into your .npmrc as the build runs.
Use packages from this VSTS/TFS registry:
  • Select this option to use one Package Management feed in the same account/collection as the build.
Advanced
Verbose logging Enables verbose logging.
Control options

Publish npm packages

Demands

npm

Arguments

Argument Description
Command npm command to run. Select publish here.
Working folder with package.json Path to the folder containing the target package.json and .npmrc files. Select the folder, not the file e.g. "/packages/mypackage".
Destination registry and authentication
Registry location
  • Registry I select here publishes to a Package Management registry in the same account/collection as the build. After you select this option, select the target registry from the dropdown.
  • External npm registry (including other accounts/collections) publishes to an external server such as npm, MyGet, or a Package Management feed in another VSTS account or TFS collection. After you select this option, create and select an npm service endpoint.
Advanced
Verbose logging Enables verbose logging.
Control options

Custom npm command

Demands

npm

Arguments

Argument Description
Command npm command to run. Select custom here.
Working folder with package.json Path to the folder containing the target package.json and .npmrc files. Select the folder, not the file e.g. "/packages/mypackage".
Command and arguments The custom command and arguments you wish to be executed.
Custom registries and authentication
Registries to use Leave this section blank to use packages from npmjs directly. Otherwise, select one of these options:
Registries in my .npmrc:
  • Select this option to use feeds specified in a .npmrc file you've checked into source control.
  • Credentials for registries outside this account/collection can be used to inject credentials you've provided as an npm service endpoint into your .npmrc as the build runs.
Use packages from this VSTS/TFS registry:
  • Select this option to use one Package Management feed in the same account/collection as the build.
Control options

Examples

Build: Gulp

Build your Node.js app with Gulp

Q&A

Where can I learn npm commands and arguments?

npm docs

Do I need an agent?

You need at least one agent to run your build or release. Get an agent.

I can't select a default agent queue and I can't queue my build or release. How do I fix this?

See queues.

I use Team Foundation Server on-premises and I don't see some of these features. Why not?

Some of these features are available only on VSTS and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.