node.js - sublime text3 configures nodejs environment and cannot compile no build system
淡淡烟草味
淡淡烟草味 2017-07-06 10:37:01
0
1
1590

I have just come into contact with node.js. When I use sublime text3 to configure the node.js compilation environment, no build system always appears.
I tried various configurations online, but all failed in the end. What is the problem? Thanks

Nodejs.sublime-build Configuration:

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

Nodejs.sublime-settings Configuration:

{
  "save_first": true,
  "node_command": "D:\Program Files\nodejs\node.exe",
  "npm_command": "D:\Program Files\nodejs\npm.cmd",
  "node_path": false,

  "expert_mode": false,

  "ouput_to_new_tab": false
}

Compile new system configuration:

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

Menu: Tools--Compilation System--Nodejs is also available, alt-R can also run Nodejs.

But it cannot be compiled, and it keeps prompting no build system

淡淡烟草味
淡淡烟草味

reply all(1)
代言

I’m not sure about your specific configuration file, but there are a few things that need to be stated:

  1. Don’t coexist between the new compilation system and the old compilation system, because both have "selector": "source.js", so you are not sure which one it calls

  2. The new build system configuration seems to be available, but remember to place it in the PackagesUser directory instead of the Packages directory

  3. In the old compilation configuration, the value of windows does not look like a valid JSON, it should be written wrong

  4. It is recommended to use cmdconfig instead of shell_cmdconfig

  5. Maybe the system calls the old configuration file, but because the content of the old configuration file itself is wrong, an error is reportedno build system

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template