简体   繁体   中英

Visual Studio 2015 Task Runner Explorer cannot get Gulp tasks?

I am using Visual Studio 2015, and I have a problem using gulp and Task Runner Explorer .

Basically my folder structure is

- Projects
         - Project
                 - gulpfile.js
                 - src
                     - scripts

When opening in VS 2015 folder Projects (Open Web Site) I cannot see any tasks in Task Runner Explorer .

Note gulpfile.js is not in the root but within Projects folder

Using instead:

- Projects
         - gulpfile.js
                  - src
                      - scripts

I can see tasks in Task Runner Explorer .

Note gulpfile.js is in the root.

Gulp is installed and works fine using the console.

// include gulp
var gulp = require('gulp'); 

// include plug-ins
var jshint = require('gulp-jshint');

// JS hint task
gulp.task('jshint', function() {
  gulp.src('./src/scripts/*.js')
    .pipe(jshint())
    .pipe(jshint.reporter('default'));
});

This my setup:

Visual Studio 2015 V 14.0.23
Web Essentials V 2015.0.5
Gulp V 3.9.0
Gulp CLI V 3.8.11

I have no issue in output window and I see only this message in Task Runner Explorer:

No task runner configuration were found

How can I make appears my tasks in Task Runner Explorer? What could be the issue?

I was having the same issue, and yes you need to ensure your gulpfile.js, node modules and package.json are placed in the root file.

Also if you're using your own installed version of Node, see this post on how to configure Visual Studio to use your installed copy.

Task Runner Explorer can't load tasks (the post with a tick beside it and a lot of people offering the individual many beers :))

Use These Steps:-

Navigate to View -> Other Windows -> Task Runner Explorer

节点安装在列表顶部

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM