Alan2
Alan2

Reputation: 24572

Visual Studio 2015 - Where's the gulp task runner?

I heard Mads Kristensen in his videos mention that Gulp and Grunt are both first class citizens. I thought I even heard mention of the Gulp task runner.

But when I create a gulpfile and right click there's no task runner.

Has anyone been able to get the "native" gulp task runner (if there is one) in Visual Studio 2015 Preview to appear?

Upvotes: 27

Views: 17092

Answers (6)

Suamere
Suamere

Reputation: 6248

In your bash, go to the directory gulpfile.js is installed in and run:

npm install gulp

Why the downvotes? Please read the OP's question and the comments beneath it. Also, note that the answer with, currently, the most points has nothing to do with the question. Also please note that Mads Kristensen himself said that the issue was to install gulp.

Also, as for the commenter "Bonner" of this answer, note that Bash doesn't mean Linux. You can install git bash for Windows and run all of your NPM and Git commands there. Most developers I know use that bash on windows for all npm needs.

Lastly, if your Gulp Task Runner is not working, that is most likely because it is not recognizing your gulpfile. That is due to gulp not being installed. VS2015 didn't always install gulp for you. So the fix was to install gulp globally (As Mads Kristensen said), or directly where your gulpfile is. Also, restarting or re-installing VS sometimes kickstarted the gulp installation if you're lucky.

Conclusion: My answer is the correct answer. I reference the actual OP Question, comments beneath it, Mads Kristensen, and even the accepted answer. Yet, this answer is in the negative and some random answer about how to use the "View" menu in Visual Studio has 40 points.

Upvotes: -2

Barryman9000's answer helped me on the right track. I started with an empty ASP.NET 5 project in VS2015 and had no package.json file at the project root. Running npm install gave me an error message about missing package.json. After adding that file with the default dependencies from another ASP.NET 5 project, the Dependencies started downloading and my gulpfile tasks appeared in the Task Runner Explorer.

Upvotes: 1

htarikyavas
htarikyavas

Reputation: 642

View > Other Windows > Task Runner Explorer and click refresh

enter image description here

or just Ctrl + Alt + Bkspace

Upvotes: 46

Duderino9000
Duderino9000

Reputation: 2597

I had this same problem with VS2015 - TRX was showing "no tasks found" even though I had a valid, linted, gulpfile.js in the site root. I found the answer here: http://www.roelvanlisdonk.nl/?p=4258

Steps: Close VS. Open a cmd prompt from the site root and run npm install. Re-open VS and you should see your tasks in TRX. It worked for me.

EDIT: I had gulp installed globally but still encountered this "error." The above steps resolved the issue though.

Upvotes: 4

Mads Kvist Kristensen
Mads Kvist Kristensen

Reputation: 2620

The Preview version of VS2015 requires Gulp to be installed globally and has a few other issues with auto-discovery of the gulpfile.js. These issues will all be addressed by the time VS2015 ships.

Upvotes: 4

Alan2
Alan2

Reputation: 24572

Well I solved the problem with several restarts of VS2015. Finally the task runner appeared for my gulpfile. I still have no idea why it did not appear from the start but it's a preview version so maybe something is not quite right yet.

Upvotes: 3

Related Questions