VSTS with gulp v.4.0.0

I'm having the gulp version of one of my projects. Previously we were using version 3.9.1 and we were hestitative updating.

After updating i have fixed all local issues and tested the project on a different computer (after updating the installed gulp there as well) it works fine.

Our automatic deployment however won't agree with me.

After a check-in our VSTS does the following steps

  1. install npm
  2. execute command
  3. build project

However, this produces the following error.

Working directory changed to D:\a\1\s\MVC
Using gulpfile D:\a\1\s\MVC\gulpfile.js
gulpInst.start.apply(gulpInst, toRun);
     TypeError: Cannot read property 'apply' of undefined
at C:\NPM\Modules\node_modules\gulp\bin\gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)

This error seems to be caused by an out of date cli version of gulp. But i can't figure out how to update this using VSTS.

Concrete problem

How do i update gulp cli in VSTS

What have i done already?

After some checking i saw the npm version installed was very old (3.10.8). I've dragged in a nodejs installer which updates to the latest version and gives me the latest version of nodejs, and a much newer version of npm (5.6.0) which i've used at on-hands computers to update the cli version. however i can't figure out how to do this in VSTS.

Try to install/update gulp-cli through NPM task:

BTW, the package in package.json will be installed on current project/folder instead of global, you need to call gulp command through npm command (scripts property of package.json) to use package in current project/folder or specify the path directly (e.g. ./node_modules/gulp/bin/gulp)

node.js - VSTS with gulp v.4.0.0, How do i update gulp cli in VSTS. What have i done already? After some checking i saw the npm version installed was very old (3.10.8). I've dragged in a nodejs  Visual Studio provides a GUI based Task Runner Explorer to link the gulp task to execute during various stages of Visual Studio build process. To get this explorer, right click gulpfile.js and click Task Runner Explorer like below. This will bring the Task Runner Explorer window at the bottom with output window tabs. Refer the below picture.

It seems that you are using Hosted Agent which the installed npm version is 3.10.8. You just need to add a Node Tool Installer task in your build definition and set it to use "8.x" version. It will install the 8.x version which include npm 5.6.0.

npm version before Node Tool Installer task: npm version after Node Tool Installer task:

VSTS with gulp v.4.0.0 - node.js - html, Concrete problem How do i update gulp cli in VSTS What have i done already? After some checking i saw the npm version installed was very old (3.10.8). The streaming build system. Contribute to gulpjs/gulp development by creating an account on GitHub.

The solution that I found worked for me was to change the Pipeline from Hosted to Hosted VS2017.

I had completed a PR that upgraded the Gulp to 4.0, and the PR build completed but the CI build failed with strange results. After a lot of searching, I narrowed it down to the PR build already being set to Hosted VS2017 (it was building C# projects too that required them) and the CI build was only doing the Gulp build and was set to Hosted.

How to Migrate to Gulp.js 4.0, To check the installation, enter gulp -v at the command line: $ gulp -v [15:15:04] CLI version 2.0.1 [15:15:04] Local version 4.0.0  gulp File Path (Required) Relative path from the repo root of the gulp file script that you want to run. Default value: gulpfile.js: targets gulp Task(s) (Optional) Space-delimited list of tasks to run. If not specified, the default task will run. arguments Arguments: Additional arguments passed to gulp.

[Gulp Task]: Global gulp version being used instead of my packages , Issue Description The global version of gulp installed on the agent is being used @daveVSTS, can you provide an ETA on this issue? We're  gulp-cli fails if local gulp is 4.0 #9. Closed ibc opened this issue Jan 13, 2015 · 11 comments Closed gulp-cli fails if local gulp is 4.0 #9.

Gulp task is not using gulp-cli but gulp · Issue #3890 · microsoft , The task should be using the node module gulp-cli and not gulp. The default configuration of the gulp runner can be found here: https://github.com/Microsoft/​vsts-tasks/blob/ update to gulp4 and we have to go and manually uninstall/​update the global version of gulp on each build task. Update gulp to gulp 4.0.0 #8886. A LESS plugin for Gulp - latest is 3.5.0 on npm. Contribute to gulp-community/gulp-less development by creating an account on GitHub.

Tutorial: Node 12 LTS + Gulp 4 + VS2019, So next step, is getting gulp updated to version 4, the latest and greatest If you want to use Gulp 4 with task manager explorer in visual studio  I am on ubuntu 16.06 and have just done a fresh install of node v6 with nvm. I have then installed gulp globally: npm i gulp -g Now when I try to run a simple gulp script I get the following error:

  • What version of gulp is your package.json asking for? I think thats your issue
  • package.json is asking for "^4.0.0"
  • If you use package.json scripts you can call to the local gulp or call it directly with ./node_modules/gulp/bin/gulp gulpfile.js, that way you dont use the system CLI and can define the exact version as you already have as ^4.0.0
  • Again the same problem :( I can get this working locally, but i don't know what command to use to get this working in VSTS. I'm taking a look at it today and will let you know if i've figured it out
  • Apologies for my late response, got sick and was out of the running for a few days. This suggestion helped fixing my problems. Key in this suggestion was the fact i should do it in the root folder of the source control instead of inside the project folder.