Visual Studio 2015 Task Runner Explorer无法获取Gulp任务?

问题描述 投票:4回答:2

我正在使用Visual Studio 2015,我使用gulp和Task Runner Explorer时遇到问题。

基本上我的文件夹结构是

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

在VS 2015文件夹Projects(开放网站)中打开时,我在Task Runner Explorer中看不到任何任务。

注意gulpfile.js不在根目录中,而是在Projects文件夹中

改为使用:

- Projects
         - gulpfile.js
                  - src
                      - scripts

我可以在Task Runner Explorer看到任务。

注意gulpfile.js在根目录中。

Gulp已安装并使用控制台正常工作。

// 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'));
});

我的设置:

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

我在输出窗口中没有问题,我在Task Runner Explorer中只看到此消息:

No task runner configuration were found

如何在Task Runner Explorer中显示我的任务?可能是什么问题?

javascript gulp visual-studio-2015 web-essentials
2个回答
2
投票

我遇到了同样的问题,是的,您需要确保将gulpfile.js,node modules和package.json放在根文件中。

此外,如果您使用自己安装的Node版本,请参阅此文章,了解如何配置Visual Studio以使用已安装的副本。

Task Runner Explorer can't load tasks(旁边有一个勾号的帖子,很多人提供个人许多啤酒:))


0
投票

使用这些步骤: -

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

Node installation at the top of the list

© www.soinside.com 2019 - 2024. All rights reserved.