1

In the Task Runner Explorer, gulpfile.js is failing to load, and in the output window I'm seeing

gulp.task('CI-html', () => {
                      ^
SyntaxError: Unexpected token )

If I comment out CI-html, Im getting another error on a let statement.

But when I run gulp from the command line in my project directory, it is not producing any errors.

Any ideas what could be the difference? Both are run with administration privilidges ..

3

It's basically a Node version issue. Assuming that you've downloaded the latest NodeJS and installed it (which means its location should be one of your system's environment variable PATH), just move up the $(PATH) location above the (DevEnvDir)|Extensions\Microsoft\Web Tools\External

For VS2015:

Tools > Options > Projects and Solutions > External Web Tools

For VS2017:

Tools > Options > Projects and Solutions > Web Package Management > External Web Tools

If it's not, you could either add the NodeJS location in the PATH environment variable or you can just directly add it on your Visual Studio shown on Shriroop's blog post.

  • My bad...updated it with more info and direct answers. – Marco Jan 17 '18 at 1:19
  • Perfect - worked for me :) – Steve Ward Jan 17 '18 at 3:05
  • Essentially () => is the "fat" arrow which is part of the EcmaScript 6 syntax. That's why you need a newer version of NodeJS to run this code. Same is the case with let. This is also part of EcmaScript 6. – Dylan Young Jan 18 '18 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.