无法使用Sublime Javascript Build工作

时间:2016-04-18 21:44:50

标签: javascript sublimetext3 build-system

您好我正在尝试使用Node在Sublime Text 3中创建一个新的Javascript Build系统。这是我在构建文件中的代码:

{
    "cmd": ["/c/Program Files/nodejs/node","$file"],
    "selector": "source.js"
}

我试图在控制台中打印一些东西,但是当我运行该程序时,我收到此错误消息:

[WinError 2] The system cannot find the file specified
[cmd: ['/c/Program Files/nodejs/node', 'C:\\Users\\Isaiah\\AppData\\Roaming\\Sublime Text 3\\Packages\\User\\node.sublime-build']]
[dir: C:\Users\Isaiah\AppData\Roaming\Sublime Text 3\Packages\User]
[path: C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Git\cmd;C:\Program Files\Boot2Docker for Windows;C:\Users\Isaiah\AppData\Local\atom\bin]
[Finished]

1 个答案:

答案 0 :(得分:2)

您可以将此格式用于PATH:

{
    "cmd": ["C:\\Users\\username\\node.exe","$file"],
    "selector": "source.js"
}