最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Unexpected token error in Task Runner - Stack Overflow

programmeradmin2浏览0评论

After updating VS 2015 to Update 2 gulp is failing executed by Task Runner Explorer, but it works fine from console.

The error is known, but I don't know how it is related to VS 2015. It does work well in VS 2013. Does VS using a different javascript interpreter than nodeJs or VS 2013 do?

It is a Windows 7, Node.js 5.10.1.

Error:

Failed to run "C:\..\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
C:\..\node_modules\gulp-inject\src\inject\index.js:127
      startTag,
              ^
SyntaxError: Unexpected token ,
    at Module._pile (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.<anonymous> (C:\..\node_modules\gulp-inject\index.js:4:28)
    at Module._pile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Failed to run "C:\..\package.json"...
Failed to run "C:\..\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
C:\..\node_modules\gulp-inject\src\inject\index.js:127
      startTag,
              ^
SyntaxError: Unexpected token ,
    at Module._pile (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.<anonymous> (C:\..\node_modules\gulp-inject\index.js:4:28)
    at Module._pile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Update:

  • I have another machine with Windows 10, Node.js 5.10.1 and with Visual Studio 2015 Update 2 where the same stuff works fine

After updating VS 2015 to Update 2 gulp is failing executed by Task Runner Explorer, but it works fine from console.

The error is known, but I don't know how it is related to VS 2015. It does work well in VS 2013. Does VS using a different javascript interpreter than nodeJs or VS 2013 do?

It is a Windows 7, Node.js 5.10.1.

Error:

Failed to run "C:\..\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
C:\..\node_modules\gulp-inject\src\inject\index.js:127
      startTag,
              ^
SyntaxError: Unexpected token ,
    at Module._pile (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.<anonymous> (C:\..\node_modules\gulp-inject\index.js:4:28)
    at Module._pile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Failed to run "C:\..\package.json"...
Failed to run "C:\..\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
C:\..\node_modules\gulp-inject\src\inject\index.js:127
      startTag,
              ^
SyntaxError: Unexpected token ,
    at Module._pile (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.<anonymous> (C:\..\node_modules\gulp-inject\index.js:4:28)
    at Module._pile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Update:

  • I have another machine with Windows 10, Node.js 5.10.1 and with Visual Studio 2015 Update 2 where the same stuff works fine
Share Improve this question edited Apr 14, 2016 at 8:18 AndrasCsanyi asked Apr 13, 2016 at 13:34 AndrasCsanyiAndrasCsanyi 4,2658 gold badges49 silver badges86 bronze badges 1
  • You need to copy what's in your image here. Third party images tend to disappear over time. – Rob Commented Apr 13, 2016 at 13:36
Add a ment  | 

2 Answers 2

Reset to default 10

I had this problem recently too - I found updating VS to use my global node install fixed it for me:

https://github./VirtoCommerce/vc-munity/issues/247#issuement-174454440

I had the same problem, but it turned out to be an issue of having an older version of NodeJS. I found this issue on github that helps:

https://github./klei/gulp-inject/issues/172

Once updated my NodeJS version to the latest, Gulp was working fine.

发布评论

评论列表(0)

  1. 暂无评论