問題描述
將 Win10 Pro/VS2015 與網站"項目(不是 asp.net,基本網站)一起使用
當嘗試保存/重新加載 gulpfile.js 時,我收到錯誤消息(來自 Task Runner Explorer/輸出)
<塊引用>語法錯誤:在嚴格模式下使用 const.
在目前的情況下,gulp-changed"令人窒息
我查看了可用的答案和評論:
- 在我的情況下,環境路徑 $(PATH) 已經包含節點的全局安裝,但我需要將它移到 $(DevEnvDir) 路徑之前,以便它獲得優先權.
(在提供正確答案后添加,感謝@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
SyntaxError: Use of const in strict mode?
- I have updated my version of node to the latest: 6.10.30
- I have cleaned the cache (npm cache clean -f)
- I have used 'which node' to determine that node is pointing to the installation of the latest install.
- "n" does not want to install on Windows (?)
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 withwhich node
).Credits to: https://github.com/sindresorhus/gulp-imagemin/issues/178#issuecomment-218131138
這篇關于Visual Studio 任務運行程序“SyntaxError:在嚴格模式下使用 const."的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!