将 Win10 Pro/VS2015 与网站"项目(不是 asp.net,基本网站)一起使用
当尝试保存/重新加载 gulpfile.js 时,我收到错误消息(来自 Task Runner Explorer/输出)
<块引用>语法错误:在严格模式下使用 const.
在目前的情况下,gulp-changed"令人窒息
我查看了可用的答案和评论:
(在提供正确答案后添加,感谢@baao)
VS 似乎安装(然后使用)旧版本的节点,这就是任务运行器中断构建的原因.
转到 工具 >选项>项目和解决方案 >外部 Web 工具 并将正确的路径添加到您的节点版本(使用 which node 查找路径).
感谢:https://github.com/sindresorhus/gulp-imagemin/issues/178#issuecomment-218131138
Using Win10 Pro / VS2015 with a 'website' project (not asp.net, basic website)
When attempt to save/reload gulpfile.js I receive the error message (from Task Runner Explorer/output)
SyntaxError: Use of const in strict mode.
In the present case it is choking on 'gulp-changed'
I have looked through the answers and comments available:
SyntaxError: Use of const in strict mode?
In my case the environment path, $(PATH) already include the global install of node but I needed to move it ahead of the $(DevEnvDir) paths so that it would get priority.
(added after correct answer provided, thanks @baao)
VS seems to install (and then use) an old version of node, which is why the task runner is breaking the build.
Go to Tools > Options > Projects and Solutions > External Web Tools and add the correct path to your node version (find the path with which node).
Credits to: https://github.com/sindresorhus/gulp-imagemin/issues/178#issuecomment-218131138
这篇关于Visual Studio 任务运行程序“SyntaxError:在严格模式下使用 const."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Browserify,Babel 6,Gulp - 传播运算符上的意外令牌Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 传播运算符上的意外令牌)
是否可以将标志传递给 Gulp 以使其以不同的方式Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以将标志传递给 Gulp 以使其以不同的方式运行任务
为什么我们需要在全局和本地安装 gulp?Why do we need to install gulp globally and locally?(为什么我们需要在全局和本地安装 gulp?)
如何一个接一个地依次运行 Gulp 任务How to run Gulp tasks sequentially one after the other(如何一个接一个地依次运行 Gulp 任务)
由于 MIME 类型而未加载样式表Stylesheet not loaded because of MIME-type(由于 MIME 类型而未加载样式表)
打开 Javascript 文件时 Visual Studio 2015 崩溃Visual Studio 2015 crashes when opening Javascript files(打开 Javascript 文件时 Visual Studio 2015 崩溃)