打造的NodeJS崇高,文本2 [英] Nodejs build sublime-text2

查看:356
本文介绍了打造的NodeJS崇高,文本2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用崇高的文本2,已经安装了的NodeJS Windows中,通过的NodeJS包控制插件,我得到了以下错误:

I am trying to use sublime-text 2, have installed Nodejs for Windows, the Nodejs plugin through package control and I get the following error:

错误:该过程node.exe找不到

ERROR: The process "node.exe" not found.

文件名,目录名或卷标语法不正确。

The filename, directory name, or volume label syntax is incorrect.

[完成了0.1秒,退出code 1]

[Finished in 0.1s with exit code 1]

我已经设置为我的用户环境变量NODE_PATH:C:\\ Program Files文件\\的NodeJS \\ node.exe
有一个在我的系统变量路径:C:\\ Program Files文件\\的NodeJS \\

I have setup as my user environment variable a NODE_PATH: C:\Program Files\nodejs\node.exe There is in my System variables PATH: C:\Program Files\nodejs\

我Nodejs.sublime-设置中设置如下:

My Nodejs.sublime-settings is set-up as follows:

{
  // save before running commands
  "save_first": true,
  // if present, use this command instead of plain "node"
  // e.g. "/usr/bin/node" or "C:\bin\node.exe"
  "node_command": "C:/Program Files/nodejs/node.exe",
  // Same for NPM command
  "npm_command": false,
  // as 'NODE_PATH' environment variable for node runtime
  "node_path": "C:/Program Files/nodejs/node.exe",

  "expert_mode": false,

  "ouput_to_new_tab": false
}

我Nodejs.sublime的构建是建立如下:

My Nodejs.sublime-build is set-up as follows:

{
  "cmd": ["C:/Program Files/nodejs/node.exe", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.js",
  "shell":true,
  "encoding": "cp1252",
  "windows":
    {
        "cmd": ["taskkill /F /IM node.exe & node", "$file"]
    },
  "linux":
    {
        "cmd": ["killall node; node", "$file"]
    }
}

作为一个方面说明,我使用JSHint它使用的NodeJS使用相同的路径(即C:/ Program Files文件/的NodeJS / node.exe),并JSHint作品!
任何想法,为什么我不能用建造的NodeJS系统?
THX

As a side note, I'm using JSHint which uses Nodejs using the same path (namely "C:/Program Files/nodejs/node.exe") and JSHint works! Any idea why I can't use Nodejs build system? Thx

推荐答案

尝试构建系统设置只是暂时如下:

Try setting your build system just to the following for the time being:

{
  "cmd": ["C:/Program Files/nodejs/node.exe", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.js",
  "shell":true,
}

由于您有一个Windows的特定部分,它的运行,而不是CMD在构建系统的第一道防线。我怀疑有某种与 TASKKILL 命令的问题。

Because you have a Windows-specific section, it's running that instead of the "cmd" on the first line of the build system. I suspect there's some sort of issue with the taskkill command.

如果这样做的工作,你觉得需要有 TASKKILL 部分回到那里,试着像这样的重组是:

If this does work, and you feel the need to have the taskkill section back in there, try restructuring it like so:

"windows":
    {
        "cmd": ["taskkill", "/F", "/IM", "node.exe", "&", "C:/Program Files/nodejs/node.exe", "$file"],
        "shell": true
    }

显然,你并不需要在那里所有的Linux部分。我也不太清楚有关Windows语法,你可能需要有两个与号&放大器;&安培; ,而不是一个人也没有 - 我知道这是在OS X和案例Linux系统。

Obviously, you don't need the linux section in there at all. I'm not too sure about the syntax on windows, you may need to have two ampersands && there instead of one - I know that's the case on OS X and Linux systems.

祝你好运!

这篇关于打造的NodeJS崇高,文本2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆