Task Runner Explorer窗口已“无法加载".在我的Gulpfile.js下,没有列出任何构建过程 [英] Task Runner Explorer window had "failed to load" under my Gulpfile.js and none of the build processes were listed

查看:53
本文介绍了Task Runner Explorer窗口已“无法加载".在我的Gulpfile.js下,没有列出任何构建过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是随机发生的,因为我正在更新CSS文件,然后刷新以注意到没有显示任何更改.最终,我注意到Gulpfile.js下的Task Runner Explorer窗口无法加载",并且未列出任何构建过程.

This happened randomly as I was updating my CSS file and then refreshing to notice no changes were being shown. I eventually noticed that Task Runner Explorer window had "failed to load" under my Gulpfile.js and none of the build processes were listed.

然后,我做了一些研究,并对外部工具的列表进行了重新排序,因为一些SO线程提到了要做的事,但没有做任何事情.然后我注意到gulpfile.js需要一些文件:

I then done a bit of research and reordered the list of external tools as some SO threads have mentioned to do and nothing. I then noticed that gulpfile.js required some files :

var gulp = require("gulp"),
   gulpless = require("gulp-less"),
   sourcemaps = require("gulp-sourcemaps"),
   rimraf = require("rimraf");

这些都不在node_modules文件夹中,所以我完成了npm install gulp-less和npm install gulp-sourcemaps的操作,现在在Output> Task Runner Explorer中检查并出现以下错误.

None of these were in the node_modules folder so I done npm install gulp-less and npm install gulp-sourcemaps and now checked in Output>Task Runner Explorer and have the following error.

无法运行"C:\ projects \ Fusion \ FusionMVC \ Gulpfile.js" ...

Failed to run "C:\projects\Fusion\FusionMVC\Gulpfile.js"...

cmd.exe/c gulp --tasks-simple

cmd.exe /c gulp --tasks-simple

C:\ projects \ Fusion \ node_modules \ gulp-sourcemaps \ node_modules \ strip-.bom \ index.js:2

C:\projects\Fusion\node_modules\gulp-sourcemaps\node_modules\strip-.bom\index.js:2

module.exports = x => {^语法错误:意外令牌>在Module._compile(module.js:439:25)在Object.Module._extensions..js(module.js:474:10)在Module.load(module.js:356:32)在Function.Module._load(module.js:312:12)在Module.require(module.js:364:17)在需要时(module.js:380:17)在对象.(C:\ projects \ Fusion \ node_modules \ gulp-sourcemaps \ src \ init.js:10:14)在Module._compile(module.js:456:26)在Object.Module._extensions..js(module.js:474:10)在Module.load(module.js:356:32)在Function.Module._load(module.js:312:12)

module.exports = x => { ^ SyntaxError: Unexpected token > at Module._compile (module.js:439:25) 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. (C:\projects\Fusion\node_modules\gulp-sourcemaps\src\init.js:10:14) 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)

关于什么可能是错误的以及如何使其起作用的任何线索或解决方案都将是很棒的!大部分的SO线程都消失了,该解决方案无法正常工作.

Any clues or solutions as to what might be wrong and how to get it working would be great! Gone through most of the SO threads and that solution did not work.

推荐答案

因此,经过大量研究,通过SO线程和npm教程,我终于找到了问题.看起来PATH变量(不确定使用的是系统级别还是用户级别1)可能不正确.我从未接触过它们,但是在将直接路径添加到本地安装的packages文件夹并将其放置在外部工具位置列表的顶部之后,它起作用了.

So after tonnes of research, working through SO threads and npm tutorials I finally found the issue. It looks like the PATH variable (not sure if it used the system or user level one) might have been incorrect. I have never touched them but after adding a direct path to the locally installed packages folder and putting it at the top of the external tools locations list it worked.

在担心路径之前需要寻找的一些东西是:

A few things to look for though before even worrying about the path would be:

  • 确保已安装所有正确的npm软件包
  • gulpfile.js代码正确
  • node.js和npm都是最新的

这篇关于Task Runner Explorer窗口已“无法加载".在我的Gulpfile.js下,没有列出任何构建过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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