I have some Gulp
tasks to do the typical clean
, build
, release
actions for a website. Nothing particularly unusual in my mind. (In fact it's very similar to Aurelia TypeScript skeleton.)
Most of the team does front-end development using Gulp
from a PowerShell / Command prompt and editing with VS Code / Sublime. Some of the team does the same using Visual Studio 2015.
Running the build
task from the command prompt works just fine, but if we run it from Visual Studio's Task Runner Explorer, it gives us an error.
However, running the other tasks (e.g. clean
) works just fine from both the command prompt and the VS Task Runner Explorer.
Interestingly, the Task Runner explorer even outputs a copy of the process it invokes to run the task. If I copy that exact command (see below) and run that in a command prompt, it does not give the error. It only happens when run from Task Runner Explorer, and only that one task.
Here's the task command line and related error output from the Task Runner Explorer:
cmd.exe /c gulp -b "D:\Development\xxxx\WebSite" --color --gulpfile "D:\Development\xxxx\WebSite\Gulpfile.js" build
[20:40:42] Using gulpfile D:\Development\xxxx\WebSite\Gulpfile.js
[20:40:42] Starting 'build'...
[20:40:42] Starting 'clean'...
[20:40:42] Finished 'clean' after 5.74 ms
[20:40:42] Starting 'build-system'...
[20:40:42] Starting 'build-html'...
[20:40:42] Starting 'build-css'...
[20:40:42] Finished 'build-css' after 31 ms
[20:40:43] Finished 'build-html' after 162 ms
D:\Development\xxxx\WebSite\node_modules\gulp-tsb\lib\builder.js:153
var newLastBuildVersion = new Map();
^
ReferenceError: Map is not defined
at Object.build (D:\Development\xxxx\WebSite\node_modules\gulp-tsb\lib\builder.js:153:39)
at Stream.<anonymous> (D:\Development\xxxx\WebSite\node_modules\gulp-tsb\lib\index.js:40:22)
at _end (D:\Development\xxxx\WebSite\node_modules\through\index.js:65:9)
at Stream.stream.end (D:\Development\xxxx\WebSite\node_modules\through\index.js:74:5)
at DestroyableTransform.onend (D:\Development\xxxx\WebSite\node_modules\readable-stream\lib\_stream_readable.js:545:10)
at DestroyableTransform.g (events.js:180:16)
at DestroyableTransform.emit (events.js:117:20)
at endReadableNT (D:\Development\xxxx\WebSite\node_modules\readable-stream\lib\_stream_readable.js:960:12)
Process terminated with code 8.
at afterTick (D:\Development\xxxx\WebSite\node_modules\process-nextick-args\index.js:18:8)
at process._tickCallback (node.js:419:13)
My Google-Fu has come up empty on the error message / stack trace or related searches.
What gives?
UPDATE: As per @josh-graham, the version of Node being invoked by VS is listed below.
[10:12:48] Starting 'clean'...
Version: v0.10.31
[10:12:48] Finished 'clean' after 42 ms