Gulp task failing when run from VS 2015 Task Runner explorer, but not from command prompt

梦想的初衷 提交于 2019-11-27 14:05:26

VS ships with an old version of Node.js and does not indicate whether an update will be coming any time soon, even with Update 2 coming out. Your system likely has a newer version. To fix this in Visual Studio, you need to prioritize your PATH (assuming you have node on your PATH). Simply find the "External Web Tools" option, and move $(PATH) to the top of the following...

See this for more detail - Customize external web tools in Visual Studio 2015. Also, sorry for the picture, but it seems to be the most straightforward way to explain the issue.


After seeing this answer grow in popularity to help others, I continued to dig into why this is still somehow an issue. I looked into the current Node.js Tools remarks for update 3 and still do not see any information regarding a version in their summary of updates as follows...

  • Faster, better ES6 IntelliSense
  • More reliable debugging
  • Improved Unit Testing experiences (including Tape support)
  • .npm command in more project types

To go down the rabbit hole a little bit to see if their exact version choice is glaringly obvious (which it is not) I did find the following on their github repository...

this.versions = {node: '0.10.0', v8: '3.14.5.8'};

Could this be it? Unsure, but I'm thinking they're still not on board with shipping VS with newer versions of Node.js.

See if you can print out the node version that Visual Studio is shelling out to. It is likely that the version of Node that Visual Studio is using is different than the one you are using at the console. The Map collection looks like it was introduced in Node v4.0.0 https://nodejs.org/en/blog/release/v4.0.0/

You should be able to log the Node version using

console.log('Version: ' + process.version);

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!