Azure-pipelines-tasks: Gulp step failing with Local gulp not found

Created on 5 Aug 2015  路  16Comments  路  Source: microsoft/azure-pipelines-tasks

I have an NPM install and Gulp step - the NPM install step completes OK, but then the Gulp step fails with "Local gulp not found in C:\a\bf6a5db2\PROJECT"

The NPM install step has the working directory param set to -
$/PROJECT/PD Enquiries/PD/src/PDEnquiries

...and the Gulp step has the Gulp file path set to -

$/PROJECT/PD Enquiries/PD/src/PDEnquiries/gulpfile.js

I wonder if Gulp is expected to be in the root of the project, but actually it is under PD Enquiries/PD/src/PDEnquiries?

Most helpful comment

I only have 1 npm task and 1 gulp task but I keep getting the following error on the Gulp task.

Gulp is not installed globally (or is not in the path of the user the agent is running as) and it is not in the local working folder: C:\build01_work\1\s\node_modules\gulp\bin\gulp.js

Is this related to the above?

All 16 comments

Is this windows or *nix?
On the task, use the browse (...) to browse to your gulpfile. the resultant path should be relative to the root of the repo.
Is gulp in your packages.json? printing your package.json would help

Windows...

I used the (...) to add the gulpfile path, but still no joy.

Gulp is in my package.json file and all is working ok locally. Contents of package.json is

{
"version": "1.0.0",
"name": "PDEnquiries",
"private": true,
"dependencies": {

},
"devDependencies": {
"phantomjs": "_",
"gulp-karma": "_",
"karma": "0.13",
"karma-jasmine": "_",
"karma-phantomjs-launcher": "_",
"gulp": "_",
"gulp-bower": "_",
"gulp-load-plugins": "_",
"gulp-util": "_"
}
}

OK - I'll have someone investigate. Also useful to note it's tfsvc and not git.

I am not able to repro this.
Here is what I tried:

  1. Push our vso-agent-task repo to my local tfvc team project.
  2. Create a definition:
    1
    2
    3

I got a green build without any error.

Only difference there I see is that you have another npm step to install gulp. Have tried that too, and still get the same error.

Starting task: gulp


Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\Gulp\0.5.2\Gulptask.ps1
C:\NPM\Modules\gulp.cmd --gulpfile C:\a\bf6a5db2\Sse.MSProgramme.Sharepoint\PD Enquiries\PD\src\PDEnquiries\gulpfile.js
Local gulp not found in C:\a\bf6a5db2\Sse.MSProgramme.Sharepoint
Try running: npm install gulp
Unexpected exit code 1 returned from tool gulp.cmd

image

image

It looks like the working directory is not getting set properly based on this C:\a\bf6a5db2\Sse.MSProgramme.Sharepoint @TingluoHuang that might be the best place to start looking

Still an issue?

I was having this issue. I believe the spaces in the path were the cause. This fix seems to have resolved it for me:

https://github.com/Microsoft/vso-agent-tasks/commit/1b010112c4c3a08a5ed86f908c4775622baa7558

I had to change the task manually. Is there a better way to update agent tasks?

Awesome. Thanks @brettpostin

For additional info, there's currently no way to update tasks other than manually. Should be coming in update 1...

https://twitter.com/tfsbuck/status/641238084852408322

Even though the UI has changed quite a bit here I'm still getting this error at the gulp step. Is there a more public fix somewhere?:

2017-08-17T19:43:05.9835475Z ##[section]Starting: gulp
2017-08-17T19:43:05.9835475Z ==============================================================================
2017-08-17T19:43:05.9835475Z Task : Gulp
2017-08-17T19:43:05.9835475Z Description : Node.js streaming task based build system
2017-08-17T19:43:05.9835475Z Version : 0.5.31
2017-08-17T19:43:05.9835475Z Author : Microsoft Corporation
2017-08-17T19:43:05.9835475Z Help : More Information
2017-08-17T19:43:05.9835475Z ==============================================================================
2017-08-17T19:43:06.7809784Z [command]C:\tools\nodejs\node.cmd D:\a_work\302\s\shr-ui-app\node_modules\gulp\bin\gulp.js vstsbuild --gulpfile D:\a_work\302\s\shr-ui-app --packagePath=D:\a_work\302\a
2017-08-17T19:43:06.7966040Z Node v6.9.1 and NPM v3.10.8
2017-08-17T19:43:06.7966040Z Set "USE_NODEJS0" env.var to use Node v0.10.26 and NPM v1.4.6
2017-08-17T19:43:06.7966040Z Set "USE_NODEJS4" env.var to use Node v4.2.4 and NPM v2.14.12
2017-08-17T19:43:07.6248431Z [19:43:07] Local gulp not found in D:\a_work\302\s
2017-08-17T19:43:07.6248431Z [19:43:07] Try running: npm install gulp
2017-08-17T19:43:07.6560344Z ##[error]Gulp failed with error: C:\tools\nodejs\node.cmd failed with return code: 1
2017-08-17T19:43:07.6560344Z ##[section]Finishing: gulp

image

image

image

As an FYI for others, I updated the version of my NPM Install task, and didn't notice that the working directory was blanked out. That caused the gulp task to fail because my package.json file wasn't found, and thus no local copy of gulp was found.

I had the same problem and the resolution was to give the path including guplfile.js in the gulp task:

"Intranet Core/src/gulpfile.js"

However, the npm task must not contain the package.json file name:
"Intranet Core/src"

The documentation could be a little more clear for these settings.

Sven

I only have 1 npm task and 1 gulp task but I keep getting the following error on the Gulp task.

Gulp is not installed globally (or is not in the path of the user the agent is running as) and it is not in the local working folder: C:\build01_work\1\s\node_modules\gulp\bin\gulp.js

Is this related to the above?

I resolved by removing a redundant .nprmc file in the root of the repo.

In my case, it was because I defined npm in the agent's capabilities in a wrong way. after correcting the variable and restarting the agent the problem has been resolved!

Was this page helpful?
0 / 5 - 0 ratings