【问题标题】:Why is my JavaScript builder that I set up with node.js in Sublime Text 3 not showing the build results?为什么我在 Sublime Text 3 中使用 node.js 设置的 JavaScript 构建器没有显示构建结果?
【发布时间】:2015-06-08 01:13:58
【问题描述】:

我是一个相当新的 JavaScript 程序员,我刚刚下载了 Sublime Text 3。我尝试在其上安装 node,以便我可以使用 javascript 构建,但每当我尝试使用 在其上运行简单的console.log("Hello World") 时Ctrl+B,它不显示任何内容,只是说 [Finished in 0.2s] 而没有实际将任何内容记录到控制台。

我的 Node 的 sublime 构建文件夹名为 Node.sublime-build 并包含以下内容:

{
 "cmd": ["node.exe", "${file}"],
 "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
 "working_dir": "${file_path}",
 "selector": "source.js",
 "variants":
 [
  {
   "name": "Run",
   "cmd":["node.exe", "${file}"]
  }
 ]
}

我到处寻找答案,但我就是不知道为什么没有显示结果。如果您知道出了什么问题,请告诉我。

【问题讨论】:

    标签: javascript node.js sublimetext3


    【解决方案1】:

    尝试将 Node.sublime-build 文件中的所有文本替换为:

    {   
      "cmd": ["node", "$file"],   
      "selector": "source.js"   
    }
    

    或者如果这在第二行不起作用,您可能必须指定节点的路径而不仅仅是"node";对我来说是:

    {   
      "cmd": ["/usr/local/bin/node", "$file"],   
      "selector": "source.js"   
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-01
      • 2014-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-27
      • 1970-01-01
      相关资源
      最近更新 更多