任务运行程序资源管理器无法加载任务 [英] Task Runner Explorer can't load tasks

查看:204
本文介绍了任务运行程序资源管理器无法加载任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VS2015和Gulp。我打开Task Runner Explorer并点击刷新,并在日志中显示:

 运行失败C:\ Projects \Test\Gulpfile.js... 
cmd.exe / c gulp --tasks-simple
错误:在C:\Projects\Test\\中找不到libsass`绑定\
ode_modules\gulp-sass\\\
ode_modules\\\
ode-sass\vendor\win32-ia32-11\binding.node。试着重新安装`node-sass`?
在Object.sass.getBinaryPath(C:\Projects\Test\\\
ode_modules\gulp-sass\\\
ode_modules\\\
ode-sass\lib\extensions.js:148:11)
在Object。< anonymous> (C:\Projects\Test\\\
ode_modules\gulp-sass\\\
ode_modules\\\
ode-sass\lib\index.js:16:36)
在Module._compile(module.js (Module.js:474:10)
在Module.load(module.js:356:32)
at Function.Module._extensions.js .Module._load(module.js:312:12)
at Module.require(module.js:364:17)
at require(module.js:380:17)
at对象<匿名> (C:\Projects\Test\\\
ode_modules\gulp-sass\index.js:163:21)
在Module._compile(module.js:456:26)
code>

所以我尝试运行 cmd.exe / c gulp --tasks-simple 在PowerShell中,在同一个目录下,它工作正常 - 它返回一个任务列表。



我也能够运行我的SASS相关任务很好,所以我不确定为什么当SASS通过VS运行而不是直接在命令行上抱怨SASS。

最近我从VS2013迁移出了同样的问题。



正如Josh在他的评论这里 Visual Studio 2015随附较旧版本的Node。如果您不希望被Visual Studio中内置的任何版本的节点卡住,您可以告诉它使用您已安装的版本。




  • 转至:工具>选项>项目和解决方案>外部Web工具

  • $(PATH)高于 $(DevEnvDir)\Extensions\Microsoft\Web Tools\External



这也适用于Grunt,Bower和Gulp等其他工具。



通过Mads Kristensen发现此解决方案


对于Visual Studio 2017,我们可以在以下位置找到设置:
工具>选项>项目和解决方案>网页包管理>外部Web工具



I'm using VS2015 and Gulp. I open the Task Runner Explorer and hit refresh, and this shows up in the log:

Failed to run "C:\Projects\Test\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
Error: `libsass` bindings not found in C:\Projects\Test\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-ia32-11\binding.node. Try reinstalling `node-sass`?
    at Object.sass.getBinaryPath (C:\Projects\Test\node_modules\gulp-sass\node_modules\node-sass\lib\extensions.js:148:11)
    at Object.<anonymous> (C:\Projects\Test\node_modules\gulp-sass\node_modules\node-sass\lib\index.js:16:36)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Projects\Test\node_modules\gulp-sass\index.js:163:21)
    at Module._compile (module.js:456:26)

So I try to run cmd.exe /c gulp --tasks-simple in PowerShell, in the same directory, and it works fine - it returns a list of tasks.

I'm also able to run my SASS-related tasks just fine, so I'm not sure why this is complaining about SASS when it's being run via VS but not directly on the command line.

解决方案

I had the same problem migrating from VS2013 recently.

As Josh noted in his comment here Visual Studio 2015 ships with an older version of Node. In case you don't want to get stuck with whatever version of Node is built into Visual Studio, you can tell it to use the version you have already installed.

  • Go to: Tools > Options > Projects and Solutions > External Web Tools
  • Reorder so that $(PATH) is above $(DevEnvDir)\Extensions\Microsoft\Web Tools\External

This also applies to other tools like Grunt, Bower and Gulp.

Found this solution by Mads Kristensen here.

For Visual Studio 2017, we can find the setting at
Tools > Options > Projects and Solutions > Web Package Management > External Web Tools

这篇关于任务运行程序资源管理器无法加载任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆