Gulp Task Runner – Failed to load in VS2015

I am working on a project, using open-source development techniques, similar to the SharePoint Framework (i.e. using Node.js, Gulp, SASS, Typescript and Angular) to aid my development of a SharePoint-Hosted app.

Problem

When working in Visual Studio 2015 (with update 3) with Node.js tools installed, I needed to re-install the NPM modules and found after this, the Gulp Tasks are not loaded properly showing the following error:

Task Runner Error

and the output window is showing this error:

node-sass

Solution

So after some quick Googling on the issue I found the answer on Stack Overflow (see references). The issue occurs because Visual Studio and Windows have different versions of Node.js i.e. 32-bit vs 64-bit and wrong one is being loaded for the node-sass module.

In Visual Studio 2015, go to Tools > Options >  Projects and Solutions > External Web Tools

External Web Tools in Visual Studio 2015

Change “$(PATH)” to load above “$(VSINSTALLDIR)\Web\External”

External Web Tools in Visual Studio 2015 - Fixed

Click OK, go back to the Task Runner Explorer and click the Refresh icon.

Working Gulp Task Runner

Hope this helps anyone who is encountering this issue.

Reference

Customise external web tools in Visual Studio 2015 – https://blogs.msdn.microsoft.com/webdev/2015/03/19/customize-external-web-tools-in-visual-studio-2015/

Task Runner Explorer can’t load tasks – http://stackoverflow.com/questions/31301582/task-runner-explorer-cant-load-tasks/31444245

Advertisements