Task Runner Explorer 无法加载任务 [英] Task Runner Explorer can't load tasks

查看:22
本文介绍了Task Runner Explorer 无法加载任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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:ProjectsTestGulpfile.js"...
cmd.exe /c gulp --tasks-simple
Error: `libsass` bindings not found in C:ProjectsTest
ode_modulesgulp-sass
ode_modules
ode-sassvendorwin32-ia32-11inding.node. Try reinstalling `node-sass`?
    at Object.sass.getBinaryPath (C:ProjectsTest
ode_modulesgulp-sass
ode_modules
ode-sasslibextensions.js:148:11)
    at Object.<anonymous> (C:ProjectsTest
ode_modulesgulp-sass
ode_modules
ode-sasslibindex.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:ProjectsTest
ode_modulesgulp-sassindex.js:163:21)
    at Module._compile (module.js:456:26)

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

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.

我也可以很好地运行与 SASS 相关的任务,所以我不确定为什么当它通过 VS 运行而不是直接在命令行上运行时会抱怨 SASS.

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.

推荐答案

我最近从 VS2013 迁移时遇到了同样的问题.

I had the same problem migrating from VS2013 recently.

正如 Josh 在他的评论此处中指出的那样,Visual Studio 2015 附带了旧版本的 Node.如果你不想被 Visual Studio 内置的任何版本的 Node 所困扰,你可以告诉它使用你已经安装的版本.

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.

  • 转到:工具 > 选项 > 项目和解决方案 > 外部网络工具
  • 重新排序,使 $(PATH) 高于 $(DevEnvDir)ExtensionsMicrosoftWeb ToolsExternal

这也适用于 Grunt、Bower 和 Gulp 等其他工具.

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

由 Mads Kristensen 找到此解决方案 这里.

Found this solution by Mads Kristensen here.

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

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

这篇关于Task Runner Explorer 无法加载任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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