Gulp task

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018


Gulp is not preinstalled on all hosted agents. See installed software on virtual machine images.

Use this task to run gulp tasks using the Node.js streaming task-based build system.



YAML snippet

# gulp
# Run the gulp Node.js streaming task-based build system
- task: gulp@1
    #gulpFile: 'gulpfile.js' 
    #targets: # Optional
    #arguments: # Optional
    #workingDirectory: # Optional
    #gulpjs: # Optional
    #publishJUnitResults: false # Optional
    #testResultsFiles: '**/TEST-*.xml' # Required when publishJUnitResults == True
    #testRunTitle: # Optional
    #enableCodeCoverage: false 
    #testFramework: 'Mocha' # Optional. Options: mocha, jasmine
    #srcFiles: # Optional
    #testFiles: 'test/*.js' # Required when enableCodeCoverage == True


Argument Description
gulp File Path
(Required) Relative path from the repo root of the gulp file script that you want to run.
Default value: gulpfile.js
gulp Task(s)
(Optional) Space-delimited list of tasks to run. If not specified, the default task will run.
Additional arguments passed to gulp.
Tip: --gulpfile is not needed since already added via gulpFile input above
Working Directory
(Optional) Current working directory when the script is run. Defaults to the folder where the script is located.
Argument aliases: workingDirectory
gulp.js location
(Optional) Path to an alternative gulp.js, relative to the working directory.
Argument aliases: workingDirectory
Publish to Azure Pipelines
Select this option to publish JUnit test results produced by the gulp build to Azure Pipelines
Default value: false
Test Results Files
(Required) Test results files path. Wildcards can be used. For example, **/TEST-*.xml for all XML files whose name starts with TEST-.
Default value: **/TEST-*.xml
Test Run Title
(Optional) Provide a name for the test run
Enable Code Coverage
(Optional) Select this option to enable Code Coverage using Istanbul
Default value: false
Test Framework
(Optional) Select your test framework
Default value: Mocha
Source Files
(Optional) Provide the path to your source files, that you want to hookRequire ()
Test Script Files
(Required) Provide the path to your test script files
Default value: test/*.js


Run gulp.js

On the Build tab:

Package: npm

Package: npm

Install npm.

  • Command: install

Build: gulp

Build: gulp

Run your script.

  • gulp file path: gulpfile.js
  • Advanced, gulp.js location: node_modules/gulp/bin/gulp.js

Build a Node.js app

Build your Node.js app with gulp

Open source

This task is open source on GitHub. Feedback and contributions are welcome.


Do I need an agent?

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

I'm having problems. How can I troubleshoot them?

See Troubleshoot Build and Release.

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

See Agent pools.

My NuGet push task is failing with the following error: "Error: unable to get local issuer certificate". How can I fix this?

This can be fixed by adding a trusted root certificate. You can either add the NODE_EXTRA_CA_CERTS=file environment variable to your build agent, or you can add the NODE.EXTRA.CA.CERTS=file task variable in your pipeline. See Node.js documentation for more details about this variable. See Set variables in a pipeline for instructions on setting a variable in your pipeline.

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

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