使用快捷键 cmd + shift + b
, 选择配置任务“,而后”从模板建立tasks.json文件“,而后从列表中选择”其余“。若是没有其余选项,就随便选一个。这样就建立了一个tasks.json文件啦node
{ "version": "2.0.0", "tasks": [ { "label": "console", "type": "shell", "osx": { "command": "/usr/local/bin/node ${file}" }, "linux": { "command": "/usr/bin/node ${file}" }, "windows": { "command": "C:\\Program Files\\nodejs\\node.exe ${file}" }, "group": { "kind": "build", "isDefault": true } } ] }
编辑以后保存便可。注意版本号,可能有些字段不支持了。linux
保存后,选择一个js文件,使用快捷键cmd + shift + b
,就能够看到js的console啦shell