使用VSCodedebuggingnode.js ES6代码
我遵循这个手册: https : //blogs.msdn.microsoft.com/vscode/2015/07/06/visual-studio-code-es6/
并将其添加到我的jsconfig.json
文件中:
{ // See https://go.microsoft.com/fwlink/?LinkId=759670 // for the documentation about the jsconfig.json format "compilerOptions": { "target": "es6", "module": "commonjs", "allowSyntheticDefaultImports": true }, "files": [ "app.js" ] }
添加到app.js时:
let myVar;
我收到一个语法错误:
let myVar; ^^^^^
如果我改变let
var
– 这一切都很好。 哪里不对? 我相信这是VSCode运行节点的方式:
node --debug-brk=30696 --nolazy bin/www debugger listening on port 30696
通过升级节点+将和谐参数添加到.vscode\launch.json
来.vscode\launch.json
:
"runtimeArgs": [ "--nolazy", "--harmony" ],
正确的文件扩展名是jsconfig。 json和目标地点ES6 。